diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-05-05 02:10:45 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2013-05-05 02:10:45 -0400 |
commit | 9c56383cd0525d0e6e5463e1c8a70d2e9d66fd99 (patch) | |
tree | 9ee2d285f8b0650485c35c827a0f4375881053b6 /askbot/deps | |
parent | 54891e1576a3b8ad96fcfa159c5eaf5ab9cd2446 (diff) | |
download | askbot-9c56383cd0525d0e6e5463e1c8a70d2e9d66fd99.tar.gz askbot-9c56383cd0525d0e6e5463e1c8a70d2e9d66fd99.tar.bz2 askbot-9c56383cd0525d0e6e5463e1c8a70d2e9d66fd99.zip |
hopefully fixed the askbot site mounted at a sub-url
Diffstat (limited to 'askbot/deps')
-rw-r--r-- | askbot/deps/django_authopenid/util.py | 6 | ||||
-rw-r--r-- | askbot/deps/django_authopenid/views.py | 7 |
2 files changed, 6 insertions, 7 deletions
diff --git a/askbot/deps/django_authopenid/util.py b/askbot/deps/django_authopenid/util.py index 8c9e78da..06379e1d 100644 --- a/askbot/deps/django_authopenid/util.py +++ b/askbot/deps/django_authopenid/util.py @@ -5,12 +5,12 @@ import urlparse import functools import re import random +from askbot.utils.html import site_url from openid.store.interface import OpenIDStore from openid.association import Association as OIDAssociation from openid.extensions import sreg from openid import store as openid_store import oauth2 as oauth # OAuth1 protocol - from django.db.models.query import Q from django.conf import settings from django.core.urlresolvers import reverse @@ -731,7 +731,7 @@ class OAuthConnection(object): request_url = self.parameters['request_token_url'] if callback_url: - callback_url = '%s%s' % (askbot_settings.APP_URL, callback_url) + callback_url = site_url(callback_url) request_body = urllib.urlencode(dict(oauth_callback=callback_url)) self.request_token = self.send_request( @@ -819,7 +819,7 @@ def get_oauth2_starter_url(provider_name, csrf_token): providers = get_enabled_login_providers() params = providers[provider_name] client_id = getattr(askbot_settings, provider_name.upper() + '_KEY') - redirect_uri = askbot_settings.APP_URL + reverse('user_complete_oauth2_signin') + redirect_uri = site_url(reverse('user_complete_oauth2_signin')) client = Client( auth_endpoint=params['auth_endpoint'], client_id=client_id, diff --git a/askbot/deps/django_authopenid/views.py b/askbot/deps/django_authopenid/views.py index a1ff41e9..287902a1 100644 --- a/askbot/deps/django_authopenid/views.py +++ b/askbot/deps/django_authopenid/views.py @@ -51,6 +51,7 @@ from django.utils.html import escape from django.utils.translation import ugettext as _ from django.utils.safestring import mark_safe from askbot.mail import send_mail +from askbot.utils.html import site_url from recaptcha_works.decorators import fix_recaptcha_remote_ip from askbot.deps.django_authopenid.ldap_auth import ldap_create_user from askbot.deps.django_authopenid.ldap_auth import ldap_authenticate @@ -299,7 +300,7 @@ def complete_oauth2_signin(request): client = OAuth2Client( token_endpoint=params['token_endpoint'], resource_endpoint=params['resource_endpoint'], - redirect_uri=askbot_settings.APP_URL + reverse('user_complete_oauth2_signin'), + redirect_uri=site_url(reverse('user_complete_oauth2_signin')), client_id=client_id, client_secret=client_secret ) @@ -1254,10 +1255,8 @@ def send_email_key(email, key, handler_url_name='user_account_recover'): subject = _("Recover your %(site)s account") % \ {'site': askbot_settings.APP_SHORT_NAME} - url = urlparse(askbot_settings.APP_URL) data = { - 'validation_link': url.scheme + '://' + url.netloc + \ - reverse(handler_url_name) +\ + 'validation_link': site_url(reverse(handler_url_name)) + \ '?validation_code=' + key } template = get_template('authopenid/email_validation.html') |