0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-21 18:09:02 +01:00

Fix profile picture upload not working in account settings (#12548)

Fixes #12547
This commit is contained in:
Sage Abdullah 2024-11-07 10:07:04 +00:00 committed by Matt Westcott
parent 122b9683fa
commit 246f3c7eb5
5 changed files with 7 additions and 3 deletions

View File

@ -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)

View File

@ -14,4 +14,4 @@ depth: 1
### Bug fixes
* ...
* Restore ability to upload profile picture through account settings (Sage Abdullah)

View File

@ -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"

View File

@ -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")

View File

@ -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.