Permalink
Browse files

Use `is_staff` instead of has_perm('admin') to define `is_admin` in `…

…image` view

Otherwise is_staff users are not able to get the images in the admin page
(or we must create the permission, but in this case it could be smart to
create the perm at syncdb ; btw, is_staff sounds doing the job)
  • Loading branch information...
1 parent c7e4a26 commit 80e7cd4df25f5fea658aa114dfd68b41e0bd8ba0 @yohanboniface yohanboniface committed Jul 23, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 image/views.py
View
2 image/views.py
@@ -21,7 +21,7 @@
def image(request, path, token, autogen=False):
is_admin = False
- if ("is_admin=true" in token and request and request.user.has_perm('admin')) or autogen:
+ if ("is_admin=true" in token and request and request.user.is_staff) or autogen:
parameters = token
is_admin = True
if autogen:

0 comments on commit 80e7cd4

Please sign in to comment.