Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

newforms-admin: Fixed #6819 -- When the user does not have change per…

…mission

avoid redirecting to the changelist view after deleting an object. Thanks rmyers!


git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7588 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 7b2ae6e624d2c4a16e9e262f08225371891a738d 1 parent 65ef8d4
Brian Rosner authored June 07, 2008

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  django/contrib/admin/options.py
2  django/contrib/admin/options.py
@@ -646,6 +646,8 @@ def delete_view(self, request, object_id):
646 646
             obj.delete()
647 647
             LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(self.model).id, object_id, obj_display, DELETION)
648 648
             request.user.message_set.create(message=_('The %(name)s "%(obj)s" was deleted successfully.') % {'name': force_unicode(opts.verbose_name), 'obj': force_unicode(obj_display)})
  649
+            if not self.has_change_permission(request, None):
  650
+                return HttpResponseRedirect("../../../../")
649 651
             return HttpResponseRedirect("../../")
650 652
         extra_context = {
651 653
             "title": _("Are you sure?"),

0 notes on commit 7b2ae6e

Please sign in to comment.
Something went wrong with that request. Please try again.