admin: force is_locked() to False in UserChangeForm (#42694)

Locked fields are implemented by renaming the form's fields with a
`@disabled' suffix. But it interacts badly with the Django admin
framework which expects all fields to always exist. The simplest fix for
that is to disable field locking in the admin views on User.
This commit is contained in:
Benjamin Dauvergne 2020-05-08 18:37:46 +02:00
parent a3bf1cf609
commit a35be9f28d
1 changed files with 3 additions and 0 deletions

View File

@ -224,6 +224,9 @@ class UserChangeForm(BaseUserForm):
code='missing_credential',
)
def is_field_locked(self, name):
return False
class UserCreationForm(BaseUserForm):
"""