From c0dd8f715eaceea3b4f3b70339101bc9133a9979 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 03:49:31 +0000 Subject: [PATCH 1/2] Update dependency django-allauth to ^0.57.0 --- poetry.lock | 24 +++++++++++++++++++----- pyproject.toml | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index fcaabafd0d..89524b3ae1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -413,21 +413,25 @@ bcrypt = ["bcrypt"] [[package]] name = "django-allauth" -version = "0.54.0" +version = "0.57.0" description = "Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication." optional = false python-versions = ">=3.7" files = [ - {file = "django-allauth-0.54.0.tar.gz", hash = "sha256:120e265f802b65738899c6cb627b827fde46a4d03067034c633f516c2adf3e3e"}, + {file = "django-allauth-0.57.0.tar.gz", hash = "sha256:a095ef0db7de305d9175772c78e765ebd5fceb004ae61c1383d7fc1af0f7c5b1"}, ] [package.dependencies] -Django = ">=2.0" +Django = ">=3.2" pyjwt = {version = ">=1.7", extras = ["crypto"]} python3-openid = ">=3.0.8" -requests = "*" +requests = ">=2.0.0" requests-oauthlib = ">=0.3.0" +[package.extras] +mfa = ["qrcode (>=7.0.0)"] +saml = ["python3-saml (>=1.15.0,<2.0.0)"] + [[package]] name = "django-braces" version = "1.15.0" @@ -931,6 +935,16 @@ files = [ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"}, {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"}, + {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"}, {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"}, @@ -1986,4 +2000,4 @@ testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "p [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "713457337e15a17defae0977d017270dad436d31708001ec41ff74e79249fe6b" +content-hash = "1146b20c099a7c6f00630299e556a2fcaf335c831ff73d1bb5ae831d725ab35d" diff --git a/pyproject.toml b/pyproject.toml index 9ae4cfd044..10788893e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ django-braces = "~1.15.0" djangorestframework-camel-case = "^1.3.0" django-parler-rest = "^2.1" django-parler = "^2.3" -django-allauth = "^0.54.0" +django-allauth = "^0.57.0" lxml = "^4.7.1" requests = ">=2.31.0, <2.32.0" django-cors-headers = "^4.2.0" From 0b77ead7dd02a97d17b6846c7052f5aa2c98071a Mon Sep 17 00:00:00 2001 From: Alexander Piskun Date: Mon, 25 Sep 2023 09:10:13 +0300 Subject: [PATCH 2/2] 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 25bc66985a..6faec76fa0 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 6e9b034330..8becb925d7 100644 --- a/nextcloudappstore/settings/base.py +++ b/nextcloudappstore/settings/base.py @@ -55,6 +55,7 @@ MIDDLEWARE = [ "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 0a536759f3..42c439699e 100644 --- a/nextcloudappstore/user/views.py +++ b/nextcloudappstore/user/views.py @@ -91,7 +91,9 @@ class AccountView(LoginRequiredMixin, UpdateView): 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)