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
+2 -3
View File
@@ -265,10 +265,9 @@ def login_view(request):
if not request.user.is_authenticated():
context = {'web_theme_view_type': 'plain'}
return login(request, extra_context=context, **kwargs)
else:
context = {}
return login(request, extra_context=context, **kwargs)
return HttpResponseRedirect(reverse(getattr(settings, 'LOGIN_REDIRECT_URL', 'main:home')))
def license_view(request):