summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2013-02-11 02:39:14 -0500
committerSimon Charette <charette.s@gmail.com>2013-02-11 02:39:14 -0500
commita10f3908042a71ec5ef81bf76f0f278ca5e7a596 (patch)
tree879bf91f6b9e6419b06ebc9b0bd6b739a7b99105 /django
parent5ce6a7cea25ac8e616fa6bd132ee341a240aad6f (diff)
Fixed #19044 -- Made `DeletionMixin` interpolate its `success_url`.
Thanks to nxvl and slurms for the initial patch, ptone for the review and timo for the documentation tweaks.
Diffstat (limited to 'django')
-rw-r--r--django/views/generic/edit.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/views/generic/edit.py b/django/views/generic/edit.py
index 97a6c0a698..5b97fc81c9 100644
--- a/django/views/generic/edit.py
+++ b/django/views/generic/edit.py
@@ -242,8 +242,9 @@ class DeletionMixin(object):
redirects to the success URL.
"""
self.object = self.get_object()
+ success_url = self.get_success_url()
self.object.delete()
- return HttpResponseRedirect(self.get_success_url())
+ return HttpResponseRedirect(success_url)
# Add support for browsers which only accept GET and POST for now.
def post(self, *args, **kwargs):
@@ -251,7 +252,7 @@ class DeletionMixin(object):
def get_success_url(self):
if self.success_url:
- return self.success_url
+ return self.success_url % self.object.__dict__
else:
raise ImproperlyConfigured(
"No URL to redirect to. Provide a success_url.")