diff options
author | kolaente <konrad@kola-entertainments.de> | 2018-05-09 18:29:04 +0200 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-05-09 19:29:04 +0300 |
commit | 95f2e2b57beedcdeb2b9623dc86e26f252fdd7bd (patch) | |
tree | ebfeb5b898f72fc57ac1fe9680374fdb4bc91aeb /models/user.go | |
parent | 238a997ec0b5d3e3bed0e55edcacebb44f86d373 (diff) | |
download | gitea-95f2e2b57beedcdeb2b9623dc86e26f252fdd7bd.tar.gz gitea-95f2e2b57beedcdeb2b9623dc86e26f252fdd7bd.zip |
Multiple assignees (#3705)
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/user.go b/models/user.go index 106d79ffcc..8f5ee6e5a7 100644 --- a/models/user.go +++ b/models/user.go @@ -993,7 +993,7 @@ func deleteUser(e *xorm.Session, u *User) error { // ***** END: PublicKey ***** // Clear assignee. - if _, err = e.Exec("UPDATE `issue` SET assignee_id=0 WHERE assignee_id=?", u.ID); err != nil { + if err = clearAssigneeByUserID(e, u.ID); err != nil { return fmt.Errorf("clear assignee: %v", err) } @@ -1110,8 +1110,8 @@ func GetUserByID(id int64) (*User, error) { return getUserByID(x, id) } -// GetAssigneeByID returns the user with write access of repository by given ID. -func GetAssigneeByID(repo *Repository, userID int64) (*User, error) { +// GetUserIfHasWriteAccess returns the user with write access of repository by given ID. +func GetUserIfHasWriteAccess(repo *Repository, userID int64) (*User, error) { has, err := HasAccess(userID, repo, AccessModeWrite) if err != nil { return nil, err |