Comments for customizations of UserChangeForm.

This commit is contained in:
Marcus Scholz 2020-12-25 01:36:14 +01:00
parent c71fe4cf2d
commit 14ca45d111

View File

@ -39,8 +39,10 @@ class ExplorerUserChangeForm(UserChangeForm):
class Meta:
model = User
fields = [ 'username', 'first_name', 'last_name', 'email' ]
''' Hide password hint.'''
password = None
''' Display username, but make it uneditable and not required. '''
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields['username'].required = False