Skip to content

Commit

Permalink
fix: OpenTreeHole#163 admin changes other user's profile
Browse files Browse the repository at this point in the history
  • Loading branch information
ppolariss committed Oct 10, 2024
1 parent 05bc589 commit b01b6a1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apis/user/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ func ModifyUser(c *fiber.Ctx) error {
return err
}

// has_answered_questions will be invalid when user changes other user's profile
if user.ID != userID {
err = DB.First(&user, userID).Error
if err != nil {
return err
}
}

err = modifyUser(c, user, body)
if err != nil {
return err
Expand Down

0 comments on commit b01b6a1

Please sign in to comment.