Commit 3b1c0feca514901372ff1d688a786e6cb764edfc
1 parent
2d4f4161
Exists in
master
and in
5 other branches
Changin filters to not show button when is admin [Issues: #192 & #195]
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
courses/templatetags/custom_filters.py
... | ... | @@ -7,7 +7,7 @@ register = template.Library() |
7 | 7 | def show_subject_subscribe(user, subject): |
8 | 8 | if not user is None: |
9 | 9 | if user.is_authenticated: |
10 | - if has_role(user, 'student'): | |
10 | + if has_role(user, 'student') and not user.is_staff: | |
11 | 11 | if not user in subject.students.all() and subject.show_subscribe: |
12 | 12 | return True |
13 | 13 | |
... | ... | @@ -17,7 +17,7 @@ def show_subject_subscribe(user, subject): |
17 | 17 | def show_course_subscribe(user, course): |
18 | 18 | if not user is None: |
19 | 19 | if user.is_authenticated: |
20 | - if has_role(user, 'student'): | |
20 | + if has_role(user, 'student') and not user.is_staff: | |
21 | 21 | if not user in course.students.all() and course.show_subscribe: |
22 | 22 | return True |
23 | 23 | ... | ... |