Allow user to provide his first and last name on registration.

This commit is contained in:
Marcus Scholz 2020-12-24 19:36:41 +01:00
parent 07ea2f164c
commit a7c8848fd6
2 changed files with 10 additions and 2 deletions

View File

@ -13,7 +13,7 @@ from lostplaces.models import Place, PlaceImage, Voucher
class ExplorerCreationForm(UserCreationForm): class ExplorerCreationForm(UserCreationForm):
class Meta: class Meta:
model = User model = User
fields = ('username', 'email') fields = ('username', 'email', 'first_name', 'last_name')
voucher = forms.CharField( voucher = forms.CharField(
max_length=30, max_length=30,
help_text=_('The Voucher you got from an administrator') help_text=_('The Voucher you got from an administrator')
@ -38,7 +38,7 @@ class ExplorerCreationForm(UserCreationForm):
class ExplorerChangeForm(UserChangeForm): class ExplorerChangeForm(UserChangeForm):
class Meta: class Meta:
model = User model = User
fields = ('username', 'email') fields = ('username', 'email', 'first_name', 'last_name')
class PlaceForm(forms.ModelForm): class PlaceForm(forms.ModelForm):
class Meta: class Meta:

View File

@ -19,6 +19,14 @@
{% include 'partials/form/inputField.html' with field=form.email %} {% include 'partials/form/inputField.html' with field=form.email %}
</div> </div>
</div> </div>
<div class="LP-Form__Composition LP-Form__Composition--breakable">
<div class="LP-Form__Field">
{% include 'partials/form/inputField.html' with field=form.first_name %}
</div>
<div class="LP-Form__Field">
{% include 'partials/form/inputField.html' with field=form.last_name %}
</div>
</div>
<div class="LP-Form__Composition"> <div class="LP-Form__Composition">
<div class="LP-Form__Field"> <div class="LP-Form__Field">