From 2972ecdb6b471ebd94b2341fcb1b46fb20e93fcd Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 6 Oct 2022 21:34:03 +0200 Subject: [PATCH 3/3] misc: inherit from authentic2_auh_saml AppConfig (#69739) --- src/authentic2_auth_fedict/__init__.py | 1 - src/authentic2_auth_fedict/apps.py | 15 ++++----------- src/authentic2_auth_fedict/urls.py | 2 +- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/authentic2_auth_fedict/__init__.py b/src/authentic2_auth_fedict/__init__.py index 42b5f0b..23e093e 100644 --- a/src/authentic2_auth_fedict/__init__.py +++ b/src/authentic2_auth_fedict/__init__.py @@ -15,4 +15,3 @@ # along with this program. If not, see . default_app_config = '%s.apps.AppConfig' % __name__ - diff --git a/src/authentic2_auth_fedict/apps.py b/src/authentic2_auth_fedict/apps.py index 4efaf4c..21aa9a2 100644 --- a/src/authentic2_auth_fedict/apps.py +++ b/src/authentic2_auth_fedict/apps.py @@ -16,15 +16,17 @@ import json -import django.apps +from authentic2_auth_saml.apps import AppConfig from django.contrib.auth.signals import user_logged_in from django.utils.translation import ugettext_lazy as _ -class AppConfig(django.apps.AppConfig): +class AppConfig(AppConfig): name = 'authentic2_auth_fedict' def ready(self): + super().ready() + from . import signals user_logged_in.connect(signals.on_user_logged_in) @@ -48,15 +50,6 @@ class Plugin: def get_authentication_backends(self): return ['authentic2_auth_fedict.backends.FedictBackend'] - def redirect_logout_list(self, request, next_url=None): - from mellon.views import logout - - if 'mellon_session' in request.session: - response = logout(request) - if 'Location' in response: - return [response['Location']] - return [] - def registration_form_prefill(self, request): if request.token.get('first_name'): return [ diff --git a/src/authentic2_auth_fedict/urls.py b/src/authentic2_auth_fedict/urls.py index e6e78d4..971ba43 100644 --- a/src/authentic2_auth_fedict/urls.py +++ b/src/authentic2_auth_fedict/urls.py @@ -19,7 +19,7 @@ from django.conf.urls import include, url from . import views urlpatterns = [ - url(r'^accounts/saml/', include('mellon.urls')), + url(r'^accounts/saml/', include('mellon.urls'), kwargs={'logout_next_url': '/logout/'}), url( r'^accounts/fedict/login/$', views.login, -- 2.37.2