From b853bc3985caa4260dddb12a4b1ab73fb13ea747 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C3=ADas=20Aguirre?= Date: Mon, 15 Nov 2010 19:30:57 -0200 Subject: [PATCH] Removed incorrect namespace name from complete url in view, replaced with setting value --- README.rst | 3 +++ example/local_settings.py.template | 1 + social_auth/views.py | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f5f4e5e..e42e8c4 100644 --- a/README.rst +++ b/README.rst @@ -53,6 +53,9 @@ Installation Check Django documentation at `Login url`_ and `Login redirect url`_ +- Configure complete url name to avoid possible clashes:: + + SOCIAL_AUTH_COMPLETE_URL_NAME = 'namespace:complete' - Sync database to create needed models:: diff --git a/example/local_settings.py.template b/example/local_settings.py.template index 31339d5..6d4acc9 100644 --- a/example/local_settings.py.template +++ b/example/local_settings.py.template @@ -5,3 +5,4 @@ FACEBOOK_API_SECRET = '' SOCIAL_AUTH_CREATE_USERS = True SOCIAL_AUTH_FORCE_RANDOM_USERNAME = False SOCIAL_AUTH_DEFAULT_USERNAME = 'socialauth_user' +SOCIAL_AUTH_COMPLETE_URL_NAME = 'social:complete' diff --git a/social_auth/views.py b/social_auth/views.py index d71bd47..d3454a9 100644 --- a/social_auth/views.py +++ b/social_auth/views.py @@ -22,8 +22,11 @@ def auth(request, backend): if backend not in BACKENDS: return HttpResponseServerError('Incorrect authentication service') request.session[REDIRECT_FIELD_NAME] = request.GET.get(REDIRECT_FIELD_NAME, - settings.LOGIN_REDIRECT_URL) - redirect = reverse('social:complete', args=(backend,)) + settings.LOGIN_REDIRECT_URL) + + redirect = reverse(getattr(settings, 'SOCIAL_AUTH_COMPLETE_URL_NAME', + 'complete'), + args=(backend,)) backend = BACKENDS[backend](request, redirect) if backend.uses_redirect: return HttpResponseRedirect(backend.auth_url()) -- 2.39.5