UPDATE:
You could change create_inactive_user
on Registration/Models.py
to look like this...
def create_inactive_user(self, username, email, password,
site, send_email=True, first_name=None, last_name=None):
"""
Create a new, inactive ``User``, generate a
``RegistrationProfile`` and email its activation key to the
``User``, returning the new ``User``.
By default, an activation email will be sent to the new
user. To disable this, pass ``send_email=False``.
"""
new_user = User.objects.create_user(username, email, password)
new_user.is_active = False
new_user.first_name = first_name
new_user.last_name = last_name
new_user.save()
registration_profile = self.create_profile(new_user)
if send_email:
registration_profile.send_activation_email(site)
return new_user
Notice it is now accepting first_name
and last_name
. Also notice the new_user.first_name = first_name
and new_user.last_name = last_name
Then on Registration/backends/default/views.py
you'll want register
to look like this...
def register(self, request, **cleaned_data):
username, email, password, first_name, last_name = cleaned_data['username'], cleaned_data['email'], cleaned_data['password1'], cleaned_data['firstname'], cleaned_data['lastname']
if Site._meta.installed:
site = Site.objects.get_current()
else:
site = RequestSite(request)
new_user = RegistrationProfile.objects.create_inactive_user(username, email, password, site, first_name, last_name)
signals.user_registered.send(sender=self.__class__,
user=new_user,
request=request)
return new_user
Notice the firstname
(which is how your form is getting it) and first_name
(which is what it is being stored as then passed to the create_inactive_user
.