added user name change

This commit is contained in:
vabene1111
2020-03-18 12:51:13 +01:00
parent a8a7d4e0f4
commit 9e524a8f22
7 changed files with 63 additions and 26 deletions

View File

@ -27,6 +27,8 @@ class DateWidget(forms.DateInput):
class UserPreferenceForm(forms.ModelForm):
prefix = 'preference'
class Meta:
model = UserPreference
fields = ('theme', 'nav_color')
@ -36,6 +38,18 @@ class UserPreferenceForm(forms.ModelForm):
}
class UserNameForm(forms.ModelForm):
prefix = 'name'
class Meta:
model = User
fields = ('first_name', 'last_name')
help_texts = {
'first_name': _('Both fields are optional. If none are given the username will be displayed instead')
}
class ExternalRecipeForm(forms.ModelForm):
file_path = forms.CharField(disabled=True, required=False)
storage = forms.ModelChoiceField(queryset=Storage.objects.all(), disabled=True, required=False)