Added embedded login, and all iframe links open in new tab

This commit is contained in:
David Taylor
2016-10-06 16:08:01 +01:00
parent 1bdc4bd293
commit 441a2be0b8
5 changed files with 82 additions and 48 deletions

View File

@@ -35,6 +35,15 @@ def login(request, **kwargs):
return login(request)
def login_embed(request, **kwargs):
if request.user.is_authenticated():
next = request.REQUEST.get('next', '/')
return HttpResponseRedirect(request.REQUEST.get('next', '/'))
else:
from django.contrib.auth.views import login
return login(request, template_name="registration/login_embed.html")
"""
Called from a modal window (e.g. when an item is submitted to an event/invoice).
May optionally also include some javascript in a success message to cause a load of