diff options
author | ankitjavalkar | 2017-08-03 15:44:39 +0530 |
---|---|---|
committer | ankitjavalkar | 2017-08-24 14:55:40 +0530 |
commit | 281e28819d4ab62cc01722d90dd4951e417e16cb (patch) | |
tree | e54640073944ea6e69eabf165f3ac5964efbddcd /yaksh/decorators.py | |
parent | ceb55baf69c2f5f7346855ee5a6e5e9f77456fcb (diff) | |
download | online_test-281e28819d4ab62cc01722d90dd4951e417e16cb.tar.gz online_test-281e28819d4ab62cc01722d90dd4951e417e16cb.tar.bz2 online_test-281e28819d4ab62cc01722d90dd4951e417e16cb.zip |
Add review changes and more tests
Diffstat (limited to 'yaksh/decorators.py')
-rw-r--r-- | yaksh/decorators.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/yaksh/decorators.py b/yaksh/decorators.py index 8e5f879..9e9bc6d 100644 --- a/yaksh/decorators.py +++ b/yaksh/decorators.py @@ -21,7 +21,10 @@ def has_profile(func): if user_has_profile(request.user): return func(request, *args, **kwargs) ci = RequestContext(request) - template = 'manage.html' if 'moderator' in request.user.groups.all() else 'user.html' + if request.user.groups.filter(name='moderator').exists(): + template = 'manage.html' + else: + template = 'user.html' form = ProfileForm(user=request.user, instance=None) context = {'template': template, 'form': form} return render_to_response('yaksh/editprofile.html', context, |