Skip to content

Commit

Permalink
allow superusre as well
Browse files Browse the repository at this point in the history
  • Loading branch information
backface committed Sep 11, 2024
1 parent d6bde35 commit 057da4c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/classrooms/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class TeacherRequiredMixin(UserPassesTestMixin):

def test_func(self):
try:
return self.request.user.is_teacher
return self.request.user.is_teacher or self.request.user.is_superuser
except AttributeError:
return False

Expand Down
2 changes: 1 addition & 1 deletion templates/classrooms/group_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ <h2 class="text-5xl mb-10 text-center">My Groups</h2>

<div class="container mx-auto" >

{% if user.is_teacher %}
{% if user.is_teacher or user.is_superuser %}
<div class="my-4 text-center">
<a href="{% url 'groups:group_create' %}">
<button><i class="icon-[ion--add] mr-1"></i>Create a New Group</button>
Expand Down

0 comments on commit 057da4c

Please sign in to comment.