From a7c8848fd6ca7c68fad62af62bb444b3a5e7a49b Mon Sep 17 00:00:00 2001 From: Commander1024 Date: Thu, 24 Dec 2020 19:36:41 +0100 Subject: [PATCH] Allow user to provide his first and last name on registration. --- django_lostplaces/lostplaces/forms.py | 4 ++-- django_lostplaces/lostplaces/templates/signup.html | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/django_lostplaces/lostplaces/forms.py b/django_lostplaces/lostplaces/forms.py index 7cd51e3..4ccdff2 100644 --- a/django_lostplaces/lostplaces/forms.py +++ b/django_lostplaces/lostplaces/forms.py @@ -13,7 +13,7 @@ from lostplaces.models import Place, PlaceImage, Voucher class ExplorerCreationForm(UserCreationForm): class Meta: model = User - fields = ('username', 'email') + fields = ('username', 'email', 'first_name', 'last_name') voucher = forms.CharField( max_length=30, help_text=_('The Voucher you got from an administrator') @@ -38,7 +38,7 @@ class ExplorerCreationForm(UserCreationForm): class ExplorerChangeForm(UserChangeForm): class Meta: model = User - fields = ('username', 'email') + fields = ('username', 'email', 'first_name', 'last_name') class PlaceForm(forms.ModelForm): class Meta: diff --git a/django_lostplaces/lostplaces/templates/signup.html b/django_lostplaces/lostplaces/templates/signup.html index c3a3949..895784b 100644 --- a/django_lostplaces/lostplaces/templates/signup.html +++ b/django_lostplaces/lostplaces/templates/signup.html @@ -19,6 +19,14 @@ {% include 'partials/form/inputField.html' with field=form.email %} +
+
+ {% include 'partials/form/inputField.html' with field=form.first_name %} +
+
+ {% include 'partials/form/inputField.html' with field=form.last_name %} +
+