diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2024-02-04 14:29:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-04 13:29:09 +0000 |
commit | f8b471ace1b59bd3fc3a04c9ddb5f62dd1dd5396 (patch) | |
tree | 371d8477bd0cd4e41881b91fdb670eb33e38e8b1 /models/user/error.go | |
parent | b4513f48ce3e748ac621a6f3ddf082feca67e938 (diff) | |
download | gitea-f8b471ace1b59bd3fc3a04c9ddb5f62dd1dd5396.tar.gz gitea-f8b471ace1b59bd3fc3a04c9ddb5f62dd1dd5396.zip |
Unify user update methods (#28733)
Fixes #28660
Fixes an admin api bug related to `user.LoginSource`
Fixed `/user/emails` response not identical to GitHub api
This PR unifies the user update methods. The goal is to keep the logic
only at one place (having audit logs in mind). For example, do the
password checks only in one method not everywhere a password is updated.
After that PR is merged, the user creation should be next.
Diffstat (limited to 'models/user/error.go')
-rw-r--r-- | models/user/error.go | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/models/user/error.go b/models/user/error.go index f512994169..ef572c178a 100644 --- a/models/user/error.go +++ b/models/user/error.go @@ -108,18 +108,3 @@ func IsErrUserIsNotLocal(err error) bool { _, ok := err.(ErrUserIsNotLocal) return ok } - -type ErrUsernameNotChanged struct { - UID int64 - Name string -} - -func (err ErrUsernameNotChanged) Error() string { - return fmt.Sprintf("username hasn't been changed[uid: %d, name: %s]", err.UID, err.Name) -} - -// IsErrUsernameNotChanged -func IsErrUsernameNotChanged(err error) bool { - _, ok := err.(ErrUsernameNotChanged) - return ok -} |