Skip to content

Commit

Permalink
Merge pull request #90 from olivierdalang/fix_permissions_bug
Browse files Browse the repository at this point in the history
fix permissions issue #79
  • Loading branch information
saxix committed Feb 28, 2016
2 parents f590441 + 83768d6 commit 8e655de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions adminactions/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def base_export(modeladmin, request, queryset, title, impl, name, template, form
export a queryset to csv file
"""
opts = modeladmin.model._meta
perm = "{0}.{1}".format(opts.app_label.lower(), get_permission_codename('adminactions_export', opts))
perm = "{0}.{1}".format(opts.app_label, get_permission_codename('adminactions_export', opts))
if not request.user.has_perm(perm):
messages.error(request, _('Sorry you do not have rights to execute this action (%s)' % perm))
return
Expand Down Expand Up @@ -218,7 +218,7 @@ def export_as_fixture(modeladmin, request, queryset):
'serializer': 'json',
'indent': 4}
opts = modeladmin.model._meta
perm = "{0}.{1}".format(opts.app_label.lower(), get_permission_codename('adminactions_export', opts))
perm = "{0}.{1}".format(opts.app_label, get_permission_codename('adminactions_export', opts))
if not request.user.has_perm(perm):
messages.error(request, _('Sorry you do not have rights to execute this action (%s)' % perm))
return
Expand Down Expand Up @@ -295,7 +295,7 @@ def export_delete_tree(modeladmin, request, queryset):
That mean that dump what will be deleted if the queryset was deleted
"""
opts = modeladmin.model._meta
perm = "{0}.{1}".format(opts.app_label.lower(), get_permission_codename('adminactions_export', opts))
perm = "{0}.{1}".format(opts.app_label, get_permission_codename('adminactions_export', opts))
if not request.user.has_perm(perm):
messages.error(request, _('Sorry you do not have rights to execute this action (%s)' % perm))
return
Expand Down
2 changes: 1 addition & 1 deletion adminactions/mass_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def _doit():
updated=updated)

opts = modeladmin.model._meta
perm = "{0}.{1}".format(opts.app_label.lower(), get_permission_codename('adminactions_massupdate', opts))
perm = "{0}.{1}".format(opts.app_label, get_permission_codename('adminactions_massupdate', opts))
if not request.user.has_perm(perm):
messages.error(request, _('Sorry you do not have rights to execute this action'))
return
Expand Down
2 changes: 1 addition & 1 deletion adminactions/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def merge(modeladmin, request, queryset): # noqa
"""

opts = modeladmin.model._meta
perm = "{0}.{1}".format(opts.app_label.lower(), get_permission_codename('adminactions_merge', opts))
perm = "{0}.{1}".format(opts.app_label, get_permission_codename('adminactions_merge', opts))
if not request.user.has_perm(perm):
messages.error(request, _('Sorry you do not have rights to execute this action (%s)' % perm))
return
Expand Down

0 comments on commit 8e655de

Please sign in to comment.