Commit 0ac5ae13 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

astakos: Properly resolve urls from base host

BASE_URL contains the prefix which is also included in paths returned from
django's reverse utility. Thereby joining BASE_URL with a reverse result
generates urls with duplicate BASE_PREFIX. Replaced BASE_URL with BASE_HOST in
such cases.
parent f1616766
......@@ -164,7 +164,8 @@ def send_invitation(invitation, template_name='im/invitation.txt'):
Send invitation email.
"""
subject = _(astakos_messages.INVITATION_EMAIL_SUBJECT)
url = '%s?code=%d' % (join_urls(settings.BASE_URL, reverse('index')), invitation.code)
url = '%s?code=%d' % (join_urls(settings.BASE_HOST,
reverse('index')), invitation.code)
message = render_to_string(template_name, {
'invitation': invitation,
'url': url,
......@@ -190,7 +191,8 @@ def send_greeting(user, email_template_name='im/welcome_email.txt'):
subject = _(astakos_messages.GREETING_EMAIL_SUBJECT)
message = render_to_string(email_template_name, {
'user': user,
'url': join_urls(settings.BASE_URL, reverse('index')),
'url': join_urls(settings.BASE_HOST,
reverse('index')),
'baseurl': settings.BASE_URL,
'site_name': settings.SITENAME,
'support': settings.CONTACT_EMAIL})
......
......@@ -76,7 +76,7 @@ request_token_url = django_setting(
def get_redirect_uri():
return "%s%s" % (settings.BASE_URL,
return "%s%s" % (settings.BASE_HOST,
reverse('astakos.im.views.target.google.authenticated'))
......
......@@ -95,7 +95,7 @@ def login(
if not eppn:
raise KeyError(_(astakos_messages.SHIBBOLETH_MISSING_EPPN) % {
'domain': settings.BASE_URL,
'domain': settings.BASE_HOST,
'contact_email': settings.CONTACT_EMAIL
})
if Tokens.SHIB_DISPLAYNAME in tokens:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment