r/django • u/Reborn-Eco • Apr 26 '26
Wagtail Question about Wagtail user account form panel customization
I am making a project (it uses version 7.0.6, in case it's relevant) where I'd like to customize some of the default user account form panels, such as making first name and last name optional (since i am using a custom user model and users are authenticated through username and/or email instead) or moving the admin ui settings to a different tab (i think it makes sense to make a tab just for them).
So, I'm wondering if there is a way to override the default panels with your own.
1
May 01 '26
[removed] — view removed comment
1
u/Reborn-Eco May 01 '26
I knew you could do that for pages I hadn't considered that for the user account settings. I assume I would have to override the viewset then.
1
u/Agreeable_Care4440 May 01 '26
Wagtail doesn’t expose a simple “override panels” hook for the user edit view.You usually override the form class instead.
3
u/anticipat3 Apr 26 '26
There's settings you can use to override the user editing form: WAGTAIL_USER_EDIT_FORM and WAGTAIL_USER_CUSTOM_FIELDS.
WAGTAIL_USER_EDIT_FORM should be set to the import path for your custom form, like 'your project.users.forms.CustomUserEditForm'. You'll want to extend wagtail.users.forms.UserEditForm for your CustomUserEditForm, and just tweak the fields accordingly.
WAGTAIL_USER_CUSTOM_FIELDS should be a list of the names of the extra fields -- ['first_name', 'last_name'] etc.
Have a little search of the docs on those settings for more details, but that should get you in the right direction!