From 0b77ead7dd02a97d17b6846c7052f5aa2c98071a Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Mon, 25 Sep 2023 09:10:13 +0300 Subject: [PATCH] adjusted code to reflect Breaking Changes Signed-off-by: Alexander Piskun --- CHANGELOG.md | 3 ++- nextcloudappstore/settings/base.py | 1 + nextcloudappstore/user/views.py | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25bc66985a4..6faec76fa08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## [Unreleased] -## [4.3.3] - 2023-09-29 +## [4.3.3] - 2023-09-26 ### Changed @@ -10,6 +10,7 @@ - **npm:** Now requires `v9` or higher. - Updated python dependencies. - Updated `highlight.js` dependency to last major version. #1063 +- Updated `django-allauth` from 0.54 to 0.57. #1152 ## [4.3.2] - 2023-09-23 diff --git a/nextcloudappstore/settings/base.py b/nextcloudappstore/settings/base.py index 6e9b034330b..8becb925d78 100644 --- a/nextcloudappstore/settings/base.py +++ b/nextcloudappstore/settings/base.py @@ -55,6 +55,7 @@ "django.contrib.messages.middleware.MessageMiddleware", "django.middleware.clickjacking.XFrameOptionsMiddleware", "django.middleware.locale.LocaleMiddleware", + "allauth.account.middleware.AccountMiddleware", ] ROOT_URLCONF = "nextcloudappstore.urls" diff --git a/nextcloudappstore/user/views.py b/nextcloudappstore/user/views.py index 0a536759f38..42c439699ef 100644 --- a/nextcloudappstore/user/views.py +++ b/nextcloudappstore/user/views.py @@ -91,7 +91,9 @@ def form_invalid(self, form): def form_valid(self, form): email = EmailAddress.objects.get_primary(user=self.request.user) - email.change(None, form.cleaned_data["email"]) + if email.email != form.cleaned_data["email"]: + email.email = form.cleaned_data["email"] + email.save(update_fields=["email"]) messages.success(self.request, "Account details saved.") self.request.session["account_update_failed_count"] = 0 return super().form_valid(form)