Skip to content
Snippets Groups Projects
Commit dc839ead authored by Odin Johan Vatne's avatar Odin Johan Vatne
Browse files

Fix permission error

parent 69fe68c0
Branches
No related tags found
No related merge requests found
......@@ -458,7 +458,7 @@ def profile_page(request, username):
user_tags.exclude(tag__in=[int(tag) for tag in tag_list]).delete()
return redirect(f'/user/{request.user}/')
else:
if is_student(profile_user) and profile_user.username != request.user.username:
if is_student(request.user) and is_student(profile_user) and profile_user.username != request.user.username:
return HttpResponseForbidden("You may not view the profile of another student.")
tags = Tag.objects.all() # TODO: limit by what tags are valid
user_tags = [pair.tag for pair in user_tags]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment