From faf840a113b02b7d5d7714f2f64ac7c6e6e5363a Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Tue, 19 Mar 2013 21:13:13 +0100 Subject: [PATCH] Decoupled functions --- dpaste/views.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dpaste/views.py b/dpaste/views.py index 971d0b2..0520de2 100644 --- a/dpaste/views.py +++ b/dpaste/views.py @@ -23,7 +23,8 @@ def snippet_new(request, template_name='dpaste/snippet_new.html'): snippet_form = SnippetForm(data=request.POST, request=request) if snippet_form.is_valid(): request, new_snippet = snippet_form.save() - return HttpResponseRedirect(new_snippet.get_absolute_url()) + url = new_snippet.get_absolute_url() + return HttpResponseRedirect(url) else: snippet_form = SnippetForm(request=request) @@ -62,7 +63,8 @@ def snippet_details(request, snippet_id, template_name='dpaste/snippet_details.h snippet_form = SnippetForm(data=request.POST, request=request, initial=new_snippet_initial) if snippet_form.is_valid(): request, new_snippet = snippet_form.save(parent=snippet) - return HttpResponseRedirect(new_snippet.get_absolute_url()) + url = new_snippet.get_absolute_url() + return HttpResponseRedirect(url) else: snippet_form = SnippetForm(initial=new_snippet_initial, request=request)