Compare commits

...

2 Commits

Author SHA1 Message Date
871acd1dce Improved class comment. 2020-12-25 01:41:09 +01:00
14ca45d111 Comments for customizations of UserChangeForm. 2020-12-25 01:36:14 +01:00
2 changed files with 4 additions and 1 deletions

View File

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

View File

@ -31,8 +31,9 @@ def generate_profile_image_filename(instance, filename):
class Explorer(models.Model): class Explorer(models.Model):
""" """
Profile that is linked to the a User. Profile that is linked to the Django user.
Every user has a profile. Every user has a profile.
Provides additional attributes for user profile.
""" """
user = models.OneToOneField( user = models.OneToOneField(