old_contents: from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field, Hidden
  from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions, TabHolder, Tab, StrictButton
  from django.contrib.auth.forms import UserCreationForm, UserChangeForm, PasswordChangeForm
  from django.contrib.auth.models import User
  from crispy_forms.helper import FormHelper
  from django import forms
  
  
  class UserCreateForm(UserCreationForm):
      email = forms.EmailField(required=True)
  
      class Meta:
          model = User
          fields = ("username", "email", "password1", "password2")
  
      def save(self, commit=True):
          user = super(UserCreateForm, self).save(commit=False)
          user.email = self.cleaned_data["email"]
          if commit:
              user.save()
          return user
  
      def __init__(self, *args, **kwargs):
  
          super(UserCreateForm, self).__init__(*args, **kwargs)
  
          self.helper = FormHelper(self)
          self.helper.form_class = 'form-horizontal'
          self.helper.label_class = 'col-lg-2'
          self.helper.field_class = 'col-lg-8'
          self.helper.layout = Layout()
          tab_holder = TabHolder()
      
  class UserEditForm(UserChangeForm):
      email = forms.EmailField(required=True)
  
      class Meta:
          model = User
          fields = ("username", "email")
  
      def save(self, commit=True):
          user = super(UserChangeForm, self).save(commit=False)
          user.email = self.cleaned_data["email"]
          if commit:
              user.save()
          return user
      
      def clean_password(self):
          return ""
  
      def __init__(self, *args, **kwargs):
  
          super(UserEditForm, self).__init__(*args, **kwargs)
  
          self.helper = FormHelper(self)
          self.helper.form_class = 'form-horizontal'
          self.helper.label_class = 'col-lg-2'
          self.helper.field_class = 'col-lg-8'
          self.helper.layout = Layout()
          tab_holder = TabHolder()
  
  
new_contents: from django import forms
  from django.contrib.auth.forms import UserCreationForm, UserChangeForm, PasswordChangeForm
  from cognitive.apps.users.models import User
  
  from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions, TabHolder, Tab, StrictButton
  from crispy_forms.layout import Layout, HTML, Button, Row, Field, Hidden
  from crispy_forms.helper import FormHelper
  
  class UserCreateForm(UserCreationForm):
      email = forms.EmailField(required=True)
  
      class Meta:
          model = User
          fields = ("email", "first_name", "last_name", "password1", "password2")
  
      def save(self, commit=True):
          user = super(UserCreateForm, self).save(commit=False)
          user.email = self.cleaned_data["email"]
          user.username = user.email
          if commit:
              user.save()
          return user
  
      def __init__(self, *args, **kwargs):
  
          super(UserCreateForm, self).__init__(*args, **kwargs)
  
          self.helper = FormHelper(self)
          self.helper.form_class = 'form-horizontal'
          self.helper.label_class = 'col-lg-2'
          self.helper.field_class = 'col-lg-8'
          self.helper.layout = Layout()
          tab_holder = TabHolder()
      
  class UserEditForm(UserChangeForm):
      email = forms.EmailField(required=True)
  
      class Meta:
          model = User
          fields = ("email", "first_name", "last_name")
  
      def save(self, commit=True):
          user = super(UserChangeForm, self).save(commit=False)
          user.email = self.cleaned_data["email"]
          user.username = user.email
          if commit:
              user.save()
          return user
      
      def clean_password(self):
          return ""
  
      def __init__(self, *args, **kwargs):
  
          super(UserEditForm, self).__init__(*args, **kwargs)
  
          self.helper = FormHelper(self)
          self.helper.form_class = 'form-horizontal'
          self.helper.label_class = 'col-lg-2'
          self.helper.field_class = 'col-lg-8'
          self.helper.layout = Layout()
          tab_holder = TabHolder()
  
subject: update user creation form to use custom user model, add first last name field to form