diff options
Diffstat (limited to 'yaksh/views.py')
-rw-r--r-- | yaksh/views.py | 8 |
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) |