Commits

Simon Meers  committed 8cc4f5f

Better not to link the ModelForm to the abstract model.

  • Participants
  • Parent commits 93acea0

Comments (0)

Files changed (1)

File generic/user/email_based/forms.py

 from django import forms
+from django.contrib.auth import get_user_model
 from django.contrib.auth.forms import ReadOnlyPasswordHashField
 
-from .models import EmailBasedUser
-
 class UserCreationForm(forms.ModelForm):
     password1 = forms.CharField(label='Password', widget=forms.PasswordInput)
     password2 = forms.CharField(
         label='Password confirmation', widget=forms.PasswordInput)
 
     class Meta:
-        model = EmailBasedUser
+        model = get_user_model()
         fields = ('email', 'first_name', 'last_name')
 
     def clean_password2(self):
     password = ReadOnlyPasswordHashField()
 
     class Meta:
-        model = EmailBasedUser
+        model = get_user_model()
 
     def clean_password(self):
         return self.initial['password']