Code

Ticket #19044: 19044.diff

File 19044.diff, 777 bytes (added by nxvl, 19 months ago)
Line 
1diff --git a/django/views/generic/edit.py b/django/views/generic/edit.py
2index e51cdf5..2dc1d6a 100644
3--- a/django/views/generic/edit.py
4+++ b/django/views/generic/edit.py
5@@ -240,6 +240,7 @@ class DeletionMixin(object):
6         redirects to the success URL.
7         """
8         self.object = self.get_object()
9+        success_url = get_success_url()
10         self.object.delete()
11         return HttpResponseRedirect(self.get_success_url())
12 
13@@ -249,7 +250,7 @@ class DeletionMixin(object):
14 
15     def get_success_url(self):
16         if self.success_url:
17-            return self.success_url
18+            return self.success_url % self.object.dict
19         else:
20             raise ImproperlyConfigured(
21                 "No URL to redirect to. Provide a success_url.")