fixed admin issue and potential panics

This commit is contained in:
0xdcarns
2022-11-10 14:54:53 -05:00
parent 5ff5e5dca3
commit ea854a6b98
3 changed files with 5 additions and 2 deletions

View File

@@ -282,6 +282,9 @@ func UpdateUser(userchange models.User, user models.User) (models.User, error) {
user.Password = userchange.Password
}
if userchange.IsAdmin != user.IsAdmin {
user.IsAdmin = userchange.IsAdmin
}
err := ValidateUser(user)
if err != nil {