diff options
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, |