kopia lustrzana https://github.com/wagtail/wagtail
fix validation error on save from autocomplete (#11113)
rodzic
38e8011c50
commit
8f9cb7c007
|
@ -5,6 +5,7 @@ Changelog
|
||||||
~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
* Fix: Update system check for overwriting storage backends to recognise the `STORAGES` setting introduced in Django 4.2 (phijma-leukeleu)
|
* Fix: Update system check for overwriting storage backends to recognise the `STORAGES` setting introduced in Django 4.2 (phijma-leukeleu)
|
||||||
|
* Fix: Prevent password change form from raising a validation error when browser autocomplete fills in the "Old password" field (Chiemezuo Akujobi)
|
||||||
* Maintenance: Update BeautifulSoup upper bound to 4.12.x (scott-8)
|
* Maintenance: Update BeautifulSoup upper bound to 4.12.x (scott-8)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ depth: 1
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
|
|
||||||
* Update system check for overwriting storage backends to recognise the `STORAGES` setting introduced in Django 4.2 (phijma-leukeleu)
|
* Update system check for overwriting storage backends to recognise the `STORAGES` setting introduced in Django 4.2 (phijma-leukeleu)
|
||||||
|
* Prevent password change form from raising a validation error when browser autocomplete fills in the "Old password" field (Chiemezuo Akujobi)
|
||||||
|
|
||||||
### Documentation
|
### Documentation
|
||||||
|
|
||||||
|
|
|
@ -419,6 +419,22 @@ class TestAccountSection(WagtailTestUtils, TestCase, TestAccountSectionUtilsMixi
|
||||||
self.user.refresh_from_db()
|
self.user.refresh_from_db()
|
||||||
self.assertTrue(self.user.check_password("password"))
|
self.assertTrue(self.user.check_password("password"))
|
||||||
|
|
||||||
|
def test_ignore_change_password_if_only_old_password_supplied(self):
|
||||||
|
response = self.post_form(
|
||||||
|
{
|
||||||
|
"password-old_password": "password",
|
||||||
|
"password-new_password1": "",
|
||||||
|
"password-new_password2": "",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Check that everything runs as usual (with a redirect), instead of a validation error
|
||||||
|
self.assertRedirects(response, reverse("wagtailadmin_account"))
|
||||||
|
|
||||||
|
# Check that the password was not changed
|
||||||
|
self.user.refresh_from_db()
|
||||||
|
self.assertTrue(self.user.check_password("password"))
|
||||||
|
|
||||||
def test_change_notifications(self):
|
def test_change_notifications(self):
|
||||||
response = self.post_form(
|
response = self.post_form(
|
||||||
{
|
{
|
||||||
|
|
|
@ -209,7 +209,6 @@ class ChangePasswordPanel(BaseSettingsPanel):
|
||||||
if self.request.method == "POST":
|
if self.request.method == "POST":
|
||||||
bind_form = any(
|
bind_form = any(
|
||||||
[
|
[
|
||||||
self.request.POST.get(self.name + "-old_password"),
|
|
||||||
self.request.POST.get(self.name + "-new_password1"),
|
self.request.POST.get(self.name + "-new_password1"),
|
||||||
self.request.POST.get(self.name + "-new_password2"),
|
self.request.POST.get(self.name + "-new_password2"),
|
||||||
]
|
]
|
||||||
|
|
Ładowanie…
Reference in New Issue