Commit 38b6f781 by Bach Dániel

Merge branch 'issue-371' into 'master'

Allow superusers too see all profiles 

Closes #371

See merge request !278
parents 445a2148 5c9ae9cb
......@@ -299,7 +299,7 @@ class ProfileView(LoginRequiredMixin, DetailView):
# if the intersection of the 2 lists is empty the logged in user
# has no permission to check the target's profile
# (except if the user want to see his own profile)
if len(intersection) < 1 and target != user:
if not intersection and target != user and not user.is_superuser:
raise PermissionDenied
return super(ProfileView, self).get(*args, **kwargs)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment