mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 16:57:51 +08:00
fixed admin issue and potential panics
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user