fix(allauth_cas): Registry was removed in recent versions of allauth

This commit is contained in:
Tom Hubrecht 2024-09-17 22:21:37 +02:00
parent 77e02f3796
commit 6d76970e36
Signed by: thubrecht
SSH key fingerprint: SHA256:r+nK/SIcWlJ0zFZJGHtlAoRwq1Rm+WcKAm5ADYMoQPc
2 changed files with 4 additions and 4 deletions

View file

@ -1,4 +1,4 @@
from allauth.account.adapter import get_adapter
from allauth.socialaccount.adapter import get_adapter
from allauth.account.utils import get_next_redirect_url
from allauth.socialaccount import providers
from django.contrib.auth.signals import user_logged_out
@ -14,7 +14,7 @@ def cas_account_logout(sender, request, **kwargs):
if not provider_id:
return
provider = providers.registry.by_id(provider_id, request)
provider = get_adapter(request).get_provider(request, provider_id)
if not provider.message_suggest_caslogout_on_logout(request):
return

View file

@ -1,5 +1,5 @@
import cas
from allauth.account.adapter import get_adapter
from allauth.socialaccount.adapter import get_adapter
from allauth.account.utils import get_next_redirect_url
from allauth.socialaccount import providers
from allauth.socialaccount.helpers import (
@ -56,7 +56,7 @@ class CASAdapter:
"""
Returns a provider instance for the current request.
"""
return providers.registry.by_id(self.provider_id, self.request)
return get_adapter(self.request).get_provider(self.provider_id)
def complete_login(self, request, response):
"""