This commit is contained in:
Chris Van 2012-08-31 13:37:28 -07:00
Родитель 6251328398
Коммит 8206d94d6d
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -334,14 +334,14 @@ def external_href(url):
@jinja2.contextfunction
def get_login_link(context, to=None):
request = context['request']
# If to is given use that, otherwise get from request.
to = to or request.GET.get('to')
# If logged in, just return the URL.
if request.user.is_authenticated():
return to
url = reverse('users.login')
# If to is given use that, otherwise get from request.
to = to or request.GET.get('to')
# Don't allow loop backs to login.
if to == url:
to = None