1
0

Fixed check if the user really exists before updating/deleting its rights (#77)

This commit is contained in:
konrad
2019-05-25 10:16:55 +00:00
committed by Gitea
parent 4c4eb76fed
commit 85d08e5697
5 changed files with 35 additions and 21 deletions

View File

@ -40,6 +40,13 @@ func (lu *ListUser) Update() (err error) {
return err
}
// Check if the user exists
user, err := GetUserByUsername(lu.Username)
if err != nil {
return err
}
lu.UserID = user.ID
_, err = x.
Where("list_id = ? AND user_id = ?", lu.ListID, lu.UserID).
Cols("right").