Skip to content

Commit

Permalink
fix: more 500 errors on profile viewing
Browse files Browse the repository at this point in the history
  • Loading branch information
vas3k committed Sep 7, 2023
1 parent b3ff2fd commit 000a750
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions users/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ def profile(request, user_slug):
if not user.can_view(request.me):
return render(request, "auth/private_profile.html")

if user.moderation_status != User.MODERATION_STATUS_APPROVED and not request.me.is_moderator:
# hide unverified users
raise Http404()
if user.moderation_status != User.MODERATION_STATUS_APPROVED:
# hide unverified users (but still show to moderators)
if not request.me or not request.me.is_moderator:
raise Http404()

# select user tags and calculate similarity with me
tags = Tag.objects.filter(is_visible=True).exclude(group=Tag.GROUP_COLLECTIBLE).all()
Expand Down

0 comments on commit 000a750

Please sign in to comment.