Django - extended user model not saving
<p>I'm having trouble attempting to save data from my extended user model.</p>

<p><strong>model.py</strong></p>

<pre><code>class Person(models.Model):
"""
The 'user' field creates a link between the django-registration-redux's
default user and allows it to be extended through this model.
"""
user = models.OneToOneField(User)

# Person attributes
address = models.CharField(max_length=50)
town = models.CharField(max_length=50)
postcode = models.CharField(max_length=10)
phone_no = models.CharField(max_length=10, unique=True)

# Meta contains information about the class which is not a field.
class Meta:
    abstract = True


class Customer(Person):

# No extra attributes required for Customer.

def __str__(self):
    return self.user.username


class Staff(Person):

# Staff attributes
job_role = models.CharField(max_length=50)
medical_contact = models.CharField(max_length=50)
nation_insurance = models.CharField(max_length=50, unique=True)

def __str__(self):
    return self.user.username
</code></pre>

<p><strong>forms.py</strong></p>

<pre><code>class UserProfileForm(RegistrationFormUniqueEmail):
address = forms.CharField(max_length=50)
town = forms.CharField(max_length=50)
postcode = forms.CharField(max_length=7)
phone_no = forms.CharField(max_length=10)

class Meta:
    model = User
    fields = ['username', 'first_name', 'last_name', 'email', 'password1', 'password2']
</code></pre>

<p><strong>regbackend.py</strong></p>

<pre><code>class CustomRegistrationView(RegistrationView):
form_class = UserProfileForm

def register(self, form_class):
    new_user = super(CustomRegistrationView, self).register(form_class)
    user_profile = Customer()
    user_profile.user = new_user
    user_profile.address = form_class.cleaned_data['address']
    user_profile.town = form_class.cleaned_data['town']
    user_profile.postcode = form_class.cleaned_data['postcode']
    user_profile.phone_no = form_class.cleaned_data['phone_no']
    user_profile.save()

    return user_profile
</code></pre>

<p>So I need to save attributes of Customer through the registration form which is in the django-registration-redux app. However with my current code it will only save "User" attributes. When I attempted to change the forms model to "Customer" it won't save "User" attributes.</p>