From 4cd24c16cd0e7f85051bb6471fe3b7be7fb07642 Mon Sep 17 00:00:00 2001 From: Julian Dehm Date: Tue, 3 Dec 2024 10:41:11 +0100 Subject: [PATCH] requirements: update django-allauth to 65.x --- changelog/8450.md | 5 +++++ meinberlin/apps/users/adapters.py | 10 +++++----- meinberlin/config/settings/base.py | 2 +- requirements/base.txt | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 changelog/8450.md diff --git a/changelog/8450.md b/changelog/8450.md new file mode 100644 index 0000000000..e4c54fe982 --- /dev/null +++ b/changelog/8450.md @@ -0,0 +1,5 @@ +### Changed + +- update django-allauth to 65.x +- rename and adapt `get_email_confirmation_redirect_url` to `get_email_verification_redirect_url` +- update django-allauth settings to the new style diff --git a/meinberlin/apps/users/adapters.py b/meinberlin/apps/users/adapters.py index 86718bdf5a..9e79dd934d 100644 --- a/meinberlin/apps/users/adapters.py +++ b/meinberlin/apps/users/adapters.py @@ -46,13 +46,13 @@ def send_mail(self, template_prefix, email, context): context.update({"email": email}) return UserAccountEmail.send(email, template_name=template_prefix, **context) - def get_email_confirmation_redirect_url(self, request): - if "next" in request.GET and url_has_allowed_host_and_scheme( - request.GET["next"], allowed_hosts=None + def get_email_verification_redirect_url(self, email_address): + if "next" in self.request.GET and url_has_allowed_host_and_scheme( + self.request.GET["next"], allowed_hosts=None ): - return request.GET["next"] + return self.request.GET["next"] else: - return super().get_email_confirmation_redirect_url(request) + return super().get_email_verification_redirect_url(email_address) def clean_username(self, username): username = super().clean_username(username) diff --git a/meinberlin/config/settings/base.py b/meinberlin/config/settings/base.py index 5dd29174f8..e07af38180 100644 --- a/meinberlin/config/settings/base.py +++ b/meinberlin/config/settings/base.py @@ -271,7 +271,7 @@ ACCOUNT_LOGIN_ON_EMAIL_CONFIRMATION = True ACCOUNT_LOGIN_ON_PASSWORD_RESET = True ACCOUNT_USERNAME_REQUIRED = True -ACCOUNT_PREVENT_ENUMERATION = True +ACCOUNT_PREVENT_ENUMERATION = "strict" SOCIALACCOUNT_AUTO_SIGNUP = False SOCIALACCOUNT_EMAIL_VERIFICATION = "none" SOCIALACCOUNT_FORMS = {"signup": "meinberlin.apps.users.forms.SocialTermsSignupForm"} diff --git a/requirements/base.txt b/requirements/base.txt index 5c36af926d..8c1c339aa6 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -17,7 +17,7 @@ zeep==4.2.1 # Inherited a4-core requirements celery==5.4.0 -django-allauth==0.61.1 +django-allauth==65.3.0 django-autoslug==1.9.9 django-ckeditor==6.7.1 https://github.com/liqd/django-ckeditor-5/releases/download/v0.2.13-liqd/django_ckeditor_5-0.2.13-py3-none-any.whl