Code reduction, handle already logged in user redirection at the view and not at the template.

This commit is contained in:
Roberto Rosario
2015-04-01 14:18:05 -04:00
parent 338ac53c0f
commit e4bb97aaed
7 changed files with 41 additions and 104 deletions

View File

@@ -804,7 +804,6 @@ def document_print(request, document_id):
next = request.POST.get('next', request.GET.get('next', request.META.get('HTTP_REFERER', post_redirect or document.get_absolute_url())))
new_window_url = None
html_redirect = None
if request.method == 'POST':
form = PrintForm(request.POST)
@@ -827,7 +826,6 @@ def document_print(request, document_id):
'object': document,
'title': _('Print: %s') % document,
'next': next,
'html_redirect': html_redirect if html_redirect else html_redirect,
'new_window_url': new_window_url if new_window_url else new_window_url
}, context_instance=RequestContext(request))