title: User registration using UserCreationForm failing to save to database
body: <p>I've been learning Django and I'm trying to understand how to extend some of the built-in functionality. To do that I've referenced <a href="https://docs.djangoproject.com/en/3.0/topics/auth/customizing/" rel="nofollow noreferrer">Customizing Authentication in Django</a> and tried to implement the instructions I've found there in a standard django-admin project.</p>
  <p>The problem is that when I try to save the form to the database (sqlite3 included db), nothing is recorded. The form passes the is_valid check, but when I check the database however, nothing has been added to either my user or patients tables.</p>
  <p>Hoping someone can point out where this is going wrong, thank you.</p>
  <p><strong>models.py</strong></p>
  <pre><code>from django.db import models
  from django.contrib.auth.models import AbstractUser
  
  class User(AbstractUser):
      isPatient = models.BooleanField(default=False)
  
  class Patient(models.Model):
      user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True)
      age = models.PositiveIntegerField()
  </code></pre>
  <p><strong>forms.py</strong></p>
  <pre><code>from django import forms
  from django.contrib.auth.forms import UserCreationForm
  from django.db import transaction
  from .models import *
  
  class RegisterPatient(UserCreationForm):
      age = forms.IntegerField()
  
      class Meta:
          model = User
          fields = UserCreationForm.Meta.fields + (&quot;age&quot;)
  
      @transaction.atomic
      def save(self, commit=True):
          user = super(RegisterPatient, self).save(commit=False)
          user.isPatient = True
          user.save()
          patient = Patient.objects.create(user=user)
          patient.firstName.add(*self.cleaned_data.get('age'))
          patient.save()
  </code></pre>
  <p><strong>views.py</strong></p>
  <pre><code>def register(response):
      form = RegisterPatient(response.POST)
      if form.is_valid():
          print(&quot;is Valid&quot;) # &lt; Code reaches here
          form.save
          return redirect(&quot;/&quot;)
  </code></pre>
  <p><strong>settings.py</strong></p>
  <pre><code>AUTH_USER_MODEL = 'main.User'
  </code></pre>
  <p><strong>admin.py</strong></p>
  <pre><code>from django.contrib import admin
  from django.contrib.auth.admin import UserAdmin
  from . models import User
  
  admin.site.register(User, UserAdmin)
  </code></pre>