From 14ca45d111f572b17b9033b907d5e595f786905a Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Fri, 25 Dec 2020 01:36:14 +0100 Subject: [PATCH] Comments for customizations of UserChangeForm. --- django_lostplaces/lostplaces/forms.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/django_lostplaces/lostplaces/forms.py b/django_lostplaces/lostplaces/forms.py index 491bcd0..59cfccf 100644 --- a/django_lostplaces/lostplaces/forms.py +++ b/django_lostplaces/lostplaces/forms.py @@ -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