summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorankitjavalkar2018-07-05 17:46:00 +0530
committerankitjavalkar2018-07-13 13:00:35 +0530
commit69a07a92309105b289f4d08957729bda68727bf2 (patch)
tree085e152ce20dc050f7144e4e958788c03f972184 /yaksh/views.py
parent26ca38c6243eaa1d94bca68481eb60b2276ab7b2 (diff)
downloadonline_test-69a07a92309105b289f4d08957729bda68727bf2.tar.gz
online_test-69a07a92309105b289f4d08957729bda68727bf2.tar.bz2
online_test-69a07a92309105b289f4d08957729bda68727bf2.zip
- Add buttons to Moderator and Student templates
- Modify _add_to_moderator function to _toggle_moderator_function in order to allow addition and removal of moderator group link
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index 7cfb03f..bda2774 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -66,7 +66,7 @@ def my_render_to_response(request, template, context=None, **kwargs):
def is_moderator(user, group_name='moderator'):
"""Check if the user is having moderator rights"""
try:
- group = Group.objects.get(name='moderator')
+ group = Group.objects.get(name=group_name)
return user.profile.is_moderator and user in group.user_set.all()
except Profile.DoesNotExist:
return False
@@ -172,8 +172,10 @@ def quizlist_user(request, enrolled=None, msg=None):
)
title = 'All Courses'
- context = {'user': user, 'courses': courses, 'title': title,
- 'msg': msg}
+ context = {
+ 'user': user, 'courses': courses,
+ 'title': title, 'msg': msg
+ }
return my_render_to_response(request, "yaksh/quizzes_user.html", context)