Code

Ticket #1347: delete.diff

File delete.diff, 779 bytes (added by anonymous, 8 years ago)
Line 
1Index: django/contrib/admin/views/main.py
2===================================================================
3--- django/contrib/admin/views/main.py  (revision 2305)
4+++ django/contrib/admin/views/main.py  (working copy)
5@@ -647,7 +647,7 @@
6         obj.delete()
7         log.log_action(request.user.id, opts.get_content_type_id(), object_id, obj_display, log.DELETION)
8         request.user.add_message(_('The %(name)s "%(obj)s" was deleted successfully.') % {'name':opts.verbose_name, 'obj':obj_display})
9-        return HttpResponseRedirect("../../")
10+        return HttpResponseRedirect(request.GET.get('redirect', None) or "../../")
11     return render_to_response('admin/delete_confirmation', {
12         "title": _("Are you sure?"),
13         "object_name": opts.verbose_name,