Skip to content

Commit

Permalink
Fix issue where admins can't load a user's admin panel page when in t…
Browse files Browse the repository at this point in the history
…eams mode (CTFd#1934)

* Closes CTFd#1932
  • Loading branch information
ColdHeat authored Jul 2, 2021
1 parent 8c56468 commit 989529e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions CTFd/admin/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ def users_detail(user_id):
# Get Awards
awards = user.get_awards(admin=True)

# Get user properties
score = user.account.get_score(admin=True)
place = user.account.get_place(admin=True)
# Check if the user has an account (team or user)
# so that we don't throw an error if they dont
if user.account:
score = user.account.get_score(admin=True)
place = user.account.get_place(admin=True)
else:
score = None
place = None

return render_template(
"admin/users/user.html",
Expand Down

0 comments on commit 989529e

Please sign in to comment.