context processor: adapt to use existing logout URL for w.c.s. (#62723)

This commit is contained in:
Frédéric Péters 2022-03-14 20:17:24 +01:00
parent c0780646e6
commit 120723aeab
1 changed files with 3 additions and 1 deletions

View File

@ -197,13 +197,15 @@ def user_urls(request):
pub = get_publisher()
template_vars = (pub and pub.get_substitution_variables()) or {}
logout_url = '/logout?'
else:
template_vars = getattr(settings, 'TEMPLATE_VARS', {})
logout_url = '/logout/?'
full_path = request.get_full_path()
query_string = urlencode({'next': full_path})
context = {
'login_url': '/login/?' + query_string,
'logout_url': '/logout/?' + urlencode({'next': '/'}),
'logout_url': logout_url + urlencode({'next': '/'}),
}
absolute_uri = request.build_absolute_uri()
if 'idp_account_url' in template_vars: