1
0

Use the username instead of a user when adding a user to a team or giving it rights (#76)

This commit is contained in:
konrad
2019-05-25 09:47:16 +00:00
committed by Gitea
parent 3fffcbd986
commit 50d1f29125
19 changed files with 121 additions and 85 deletions

View File

@ -34,10 +34,11 @@ import _ "code.vikunja.io/web" // For swaggerdocs generation
func (lu *ListUser) Delete() (err error) {
// Check if the user exists
_, err = GetUserByID(lu.UserID)
user, err := GetUserByUsername(lu.Username)
if err != nil {
return
}
lu.UserID = user.ID
// Check if the user has access to the list
has, err := x.Where("user_id = ? AND list_id = ?", lu.UserID, lu.ListID).