diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2557d41adb..2984a0793a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -44,7 +44,7 @@ Changelog 6.3.1 (xx.xx.20xx) - IN DEVELOPMENT ~~~~~~~~~~~~~~~~~~ - * ... + * Fix: Restore ability to upload profile picture through account settings (Sage Abdullah) 6.3 LTS (01.11.2024) diff --git a/docs/releases/6.3.1.md b/docs/releases/6.3.1.md index d5278767dc..231cc92cc9 100644 --- a/docs/releases/6.3.1.md +++ b/docs/releases/6.3.1.md @@ -14,4 +14,4 @@ depth: 1 ### Bug fixes - * ... + * Restore ability to upload profile picture through account settings (Sage Abdullah) diff --git a/wagtail/admin/templates/wagtailadmin/generic/form.html b/wagtail/admin/templates/wagtailadmin/generic/form.html index de771c684b..19fad6c8e9 100644 --- a/wagtail/admin/templates/wagtailadmin/generic/form.html +++ b/wagtail/admin/templates/wagtailadmin/generic/form.html @@ -22,7 +22,7 @@ action="{{ action_url }}" method="POST" novalidate - {% if form.is_multipart %} enctype="multipart/form-data"{% endif %} + {% if form_is_multipart or form.is_multipart %} enctype="multipart/form-data"{% endif %} data-edit-form data-controller="w-unsaved" data-action="w-unsaved#submit beforeunload@window->w-unsaved#confirm change->w-unsaved#check keyup->w-unsaved#check" diff --git a/wagtail/admin/tests/test_account_management.py b/wagtail/admin/tests/test_account_management.py index 4a1061bf7a..cefc0c4d15 100644 --- a/wagtail/admin/tests/test_account_management.py +++ b/wagtail/admin/tests/test_account_management.py @@ -276,6 +276,9 @@ class TestAccountSection(WagtailTestUtils, TestCase, TestAccountSectionUtilsMixi # Form media should be included on the page self.assertContains(response, "vendor/colorpicker.js") + # Form should use the multipart/form-data encoding type + self.assertContains(response, 'enctype="multipart/form-data"') + # Check if the default title exists self.assertContains(response, "Name and Email") diff --git a/wagtail/admin/views/account.py b/wagtail/admin/views/account.py index 223a0363f3..5d017fac38 100644 --- a/wagtail/admin/views/account.py +++ b/wagtail/admin/views/account.py @@ -238,6 +238,7 @@ class AccountView(WagtailAdminTemplateMixin, TemplateView): context["panels_by_tab"] = self.get_panels_by_tab(panels) context["menu_items"] = self.get_menu_items() context["media"] = self.get_media(panels) + context["form_is_multipart"] = True context["user"] = self.request.user # Remove these when this view is refactored to a generic.EditView subclass. # Avoid defining new translatable strings.