Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Merge f001874 into ed4eb94
Browse files Browse the repository at this point in the history
  • Loading branch information
abithyzis committed Apr 28, 2017
2 parents ed4eb94 + f001874 commit 81ca784
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions admin_enhancer/admin.py
Expand Up @@ -30,13 +30,13 @@ def delete_view(self, request, object_id, extra_context=None):
"""Sets is_popup context variable to hide admin header."""
if not extra_context:
extra_context = {}
extra_context['is_popup'] = request.REQUEST.get('_popup', 0)
extra_context['is_popup'] = request.GET.get('_popup', 0)
return super(EnhancedAdminMixin, self).delete_view(request, object_id, extra_context)


class EnhancedModelAdminMixin(EnhancedAdminMixin):
def response_change(self, request, obj):
if '_popup' in request.REQUEST:
if '_popup' in request.GET:
return render_to_response(
'admin_enhancer/dismiss-change-related-popup.html', {'obj': obj}
)
Expand All @@ -45,7 +45,7 @@ def response_change(self, request, obj):

def delete_view(self, request, object_id, extra_context=None):
delete_view_response = super(EnhancedModelAdminMixin, self).delete_view(request, object_id, extra_context)
if (request.POST and '_popup' in request.REQUEST and
if (request.POST and '_popup' in request.GET and
isinstance(delete_view_response, HttpResponseRedirect)):
return render_to_response(
'admin_enhancer/dismiss-delete-related-popup.html', {'object_id': object_id}
Expand Down

0 comments on commit 81ca784

Please sign in to comment.