Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Generate the image in admin for all is_staff Users #2

Merged
merged 1 commit into from

2 participants

@yohanboniface

In the actual code, as the permission "admin" is not created at syncdb, only the superusers can generate the images in the admin.
Using is_staff instead of this permission sounds doing the job.
Another solution could be to add the creation of the permission during syncdb.
(Or to create it manually, but well... ;) ).
Or maybe I'm missing something. ;)

@yohanboniface yohanboniface 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)
80e7cd4
@francescortiz francescortiz merged commit 7cef1c5 into from
@francescortiz

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 23, 2012
  1. @yohanboniface

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

    yohanboniface authored
    …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)
This page is out of date. Refresh to see the latest.
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:
Something went wrong with that request. Please try again.