From 64f84188fcd89109a34056e1b5282d63c46e0c90 Mon Sep 17 00:00:00 2001 From: John Whitlock Date: Tue, 22 Sep 2015 14:39:53 -0500 Subject: [PATCH] bug 1153288 - Update django-allauth to 0.23.0 django-allauth 0.23.0 drops the context processors, which changes how the providers list is accessed. --- bcauth/helpers.py | 3 ++- bcauth/templates/account/login.jinja2 | 7 ++++--- bcauth/templates/socialaccount/connections.jinja2 | 5 +++-- requirements.txt | 2 +- wpcsite/settings.py | 2 -- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bcauth/helpers.py b/bcauth/helpers.py index ff58399..cb56b01 100644 --- a/bcauth/helpers.py +++ b/bcauth/helpers.py @@ -6,7 +6,7 @@ from allauth.account.utils import user_display from allauth.socialaccount import providers from allauth.socialaccount.templatetags.socialaccount import \ - get_social_accounts + get_social_accounts, get_providers from jinja2 import contextfunction from jingo import register @@ -56,3 +56,4 @@ def provider_login_url( register.function(user_display) register.function(get_social_accounts) +register.function(get_providers) diff --git a/bcauth/templates/account/login.jinja2 b/bcauth/templates/account/login.jinja2 index 7bc3685..f21f770 100644 --- a/bcauth/templates/account/login.jinja2 +++ b/bcauth/templates/account/login.jinja2 @@ -1,11 +1,12 @@ {% extends "account/base.jinja2" %} {% from "socialaccount/snippets/provider_list.jinja2" import list %} +{% set providers = get_providers() %} {% block head_title %}{{ _("Sign In") }}{% endblock %} {% block body_title %}{{ _("Sign In") }}{% endblock %} {% block content %} -{% if socialaccount.providers %} +{% if providers %}

{% trans site_name=site.name %}Please sign in with one of your existing third party accounts. Or, sign up for a {{site_name}} account and sign in below:{% endtrans %}

@@ -13,7 +14,7 @@ for a {{site_name}} account and sign in below:{% endtrans %}

@@ -40,7 +41,7 @@ for a {{site_name}} account and sign in below:{% endtrans %}

{% endblock %} {% block body_js_extra %} -{% if socialaccount.providers %} +{% if providers %} {{ providers_media_js() }} {% endif %} {% endblock %} diff --git a/bcauth/templates/socialaccount/connections.jinja2 b/bcauth/templates/socialaccount/connections.jinja2 index 5ee2daf..ae6f997 100644 --- a/bcauth/templates/socialaccount/connections.jinja2 +++ b/bcauth/templates/socialaccount/connections.jinja2 @@ -1,5 +1,6 @@ {% extends "account/profile.jinja2" %} {% from "socialaccount/snippets/provider_list.jinja2" import list %} +{% set providers = get_providers() %} {% block head_subtitle %} - {{ _("Account Connections") }}{% endblock %} {% block body_title %}{{ _("Account Connections") }}{% endblock %} @@ -48,13 +49,13 @@

{{ _('Add a 3rd Party Account') }}

{% endblock %} {% block body_js_extra %} -{% if socialaccount.providers %} +{% if providers %} {{ providers_media_js() }} {% endif %} {% endblock %} diff --git a/requirements.txt b/requirements.txt index f8733de..874d6d7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -84,4 +84,4 @@ git+git://github.com/erikrose/parsimonious@20863d86a#egg=parsimonious requests==2.7.0 oauthlib==0.7.2 requests-oauthlib==0.5.0 -django-allauth==0.20.0 +django-allauth==0.23.0 diff --git a/wpcsite/settings.py b/wpcsite/settings.py index d32311a..43168eb 100644 --- a/wpcsite/settings.py +++ b/wpcsite/settings.py @@ -146,8 +146,6 @@ def rel_path(*subpaths): "django.contrib.auth.context_processors.auth", "django.core.context_processors.request", "django.contrib.messages.context_processors.messages", - "allauth.account.context_processors.account", - "allauth.socialaccount.context_processors.socialaccount", ) # Email settings