From dac79c4f57b171b542590de7dbad60608ddc14eb Mon Sep 17 00:00:00 2001 From: Mara Karagianni Date: Thu, 30 May 2024 13:38:08 +0300 Subject: [PATCH] apps,deps: allauth v.63.2 --- adhocracy-plus/config/settings/base.py | 1 - adhocracy-plus/config/settings/dev.py | 2 ++ apps/users/adapters.py | 10 +++++----- apps/users/models.py | 1 + changelog/8102.md | 19 +++++++++++++++---- requirements/base.txt | 2 +- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/adhocracy-plus/config/settings/base.py b/adhocracy-plus/config/settings/base.py index 6aefc2a72..d978abe52 100644 --- a/adhocracy-plus/config/settings/base.py +++ b/adhocracy-plus/config/settings/base.py @@ -37,7 +37,6 @@ "allauth", "allauth.account", "allauth.socialaccount", - "allauth.socialaccount.providers.dummy", "rules.apps.AutodiscoverRulesConfig", "easy_thumbnails", "parler", diff --git a/adhocracy-plus/config/settings/dev.py b/adhocracy-plus/config/settings/dev.py index 95fb35f4a..26937e16c 100644 --- a/adhocracy-plus/config/settings/dev.py +++ b/adhocracy-plus/config/settings/dev.py @@ -9,6 +9,8 @@ # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = "k3l^@x53$l5@y(fo6ivgplj&q^^rmtl^enzse5ozxuepx0$s()" +INSTALLED_APPS += ("allauth.socialaccount.providers.dummy",) + try: import debug_toolbar except ImportError: diff --git a/apps/users/adapters.py b/apps/users/adapters.py index 587cfc528..f69cbb653 100644 --- a/apps/users/adapters.py +++ b/apps/users/adapters.py @@ -54,13 +54,13 @@ def get_email_confirmation_url(self, request, emailconfirmation): def send_mail(self, template_prefix, email, context): 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/apps/users/models.py b/apps/users/models.py index 28e7c5c1f..1cb0959b9 100644 --- a/apps/users/models.py +++ b/apps/users/models.py @@ -126,6 +126,7 @@ class User(auth_models.AbstractBaseUser, auth_models.PermissionsMixin): objects = auth_models.UserManager() USERNAME_FIELD = "username" + REQUIRED_FIELDS = ["email"] def get_projects_follow_list(self, exclude_private_projects=False): projects = Project.objects.filter( diff --git a/changelog/8102.md b/changelog/8102.md index 3fc4692e7..b0ab2ebf8 100644 --- a/changelog/8102.md +++ b/changelog/8102.md @@ -1,7 +1,18 @@ ### Removed - unique email constraint -- add social account autoconnect to enable social account email connecting to existing regular account -- add templates for email verification, password reset, socialaccount login, authentication error, and dummy authentication to address the template changes of allauth v.0.58.0 -- remove deprecated settings for account rate limits (removed in allauth v.0.61.0 -- update to allauth v.0.62.0 +- deprecated settings for account rate limits (removed in allauth v.0.61.0) + +### Added + +- social account autoconnect to enable social account email connecting to existing regular account +- dummy provider in dev settings for testing purposes +- templates for email verification, password reset, socialaccount login, authentication error, and dummy authentication to address the template changes of allauth v.0.58.0 + +### Changed + +- inherited adapter's method from get_email_confirmation_redirect_url to get_email_verification_redirect_url + +### Updated + +- to latest allauth v.0.63.2 diff --git a/requirements/base.txt b/requirements/base.txt index 0fe4f6b25..d8abe93a3 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -16,7 +16,7 @@ redis==5.0.4 # Inherited a4-core requirements Django==4.2.13 -django-allauth==0.62.0 +django-allauth[socialaccount]==0.63.2 git+https://github.com/liqd/django-autoslug.git@liqd2212#egg=django-autoslug django-ckeditor==6.7.1 https://github.com/liqd/django-ckeditor-5/releases/download/v0.2.12-liqd/django_ckeditor_5-0.2.12-py3-none-any.whl