Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@brosner brosner authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  django/contrib/admin/options.py
View
2  django/contrib/admin/options.py
@@ -646,6 +646,8 @@ def delete_view(self, request, object_id):
obj.delete()
LogEntry.objects.log_action(request.user.id, ContentType.objects.get_for_model(self.model).id, object_id, obj_display, DELETION)
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)})
+ if not self.has_change_permission(request, None):
+ return HttpResponseRedirect("../../../../")
return HttpResponseRedirect("../../")
extra_context = {
"title": _("Are you sure?"),
Please sign in to comment.
Something went wrong with that request. Please try again.