Skip to content

Commit

Permalink
Improve code style
Browse files Browse the repository at this point in the history
  • Loading branch information
NikAzanov committed Sep 11, 2023
1 parent ee051a7 commit 503e91b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 30 deletions.
4 changes: 2 additions & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ There are also available `settings from original django-import-export
<https://django-import-export.readthedocs.io/en/latest/installation.html#settings>`_
package.

Only `IMPORT_EXPORT_TMP_STORAGE_CLASS` setting does not affect anything, because the storage
is not used in `CeleryImportAdminMixin` implementation.
Only ``IMPORT_EXPORT_TMP_STORAGE_CLASS`` setting does not affect anything, because the storage
is not used in ``CeleryImportAdminMixin`` implementation.
14 changes: 0 additions & 14 deletions import_export_extensions/admin/mixins/export_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,20 +315,6 @@ def _redirect_to_export_results_page(
url = f"{url}?{query}"
return HttpResponseRedirect(redirect_to=url)

def has_export_permission(self, request: WSGIRequest):
"""Return whether a request has export permission."""
EXPORT_PERMISSION_CODE = getattr(
settings,
"IMPORT_EXPORT_EXPORT_PERMISSION_CODE",
None,
)
if EXPORT_PERMISSION_CODE is None:
return True

opts = self.opts
codename = get_permission_codename(EXPORT_PERMISSION_CODE, opts)
return request.user.has_perm("%s.%s" % (opts.app_label, codename))

def changelist_view(
self,
request: WSGIRequest,
Expand Down
14 changes: 0 additions & 14 deletions import_export_extensions/admin/mixins/import_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,20 +384,6 @@ def _redirect_to_results_page(

return HttpResponseRedirect(redirect_to=url)

def has_import_permission(self, request: WSGIRequest):
"""Return whether a request has import permission."""
IMPORT_PERMISSION_CODE = getattr(
settings,
"IMPORT_EXPORT_IMPORT_PERMISSION_CODE",
None,
)
if IMPORT_PERMISSION_CODE is None:
return True

opts = self.opts
codename = get_permission_codename(IMPORT_PERMISSION_CODE, opts)
return request.user.has_perm("%s.%s" % (opts.app_label, codename))

def changelist_view(
self,
request: WSGIRequest,
Expand Down

0 comments on commit 503e91b

Please sign in to comment.