python – Manager isn’t available; ‘auth.User’ has been swapped for ‘persons.User’


Tengo el siguiente problema con Django 3.1

Estuve armando un AbstractUser para poder hacer un login y registro por contraseña, pero al momento de querer hacer el registro me sale el error:

Manager isn’t available; ‘auth.User’ has been swapped for ‘persons.User’

Este es mi views.py:

from django.shortcuts import render, redirect
from django.urls import reverse

from django.contrib.auth import get_user_model
User = get_user_model()

from django.contrib.auth import authenticate
from django.contrib.auth.forms import AuthenticationForm
from django.contrib.auth import login as do_login

from django.contrib.auth.forms import UserCreationForm
from .forms import UserForm

from django.contrib.auth import logout as do_logout

from .forms import UserForm



# Create your views here.
def login(request):

    # Creamos el formulario de autenticación vacío
    form = AuthenticationForm()
    if request.method == "POST":
        # Añadimos los datos recibidos al formulario
        form = AuthenticationForm(data=request.POST)
        # Si el formulario es válido...
        if form.is_valid():
            # Recuperamos las credenciales validadas
            username = form.cleaned_data('username')
            password = form.cleaned_data('password')

            # Verificamos las credenciales del usuario
            user = authenticate(username=username, password=password)

            # Si existe un usuario con ese nombre y contraseña
            if user is not None:
                # Hacemos el login manualmente
                do_login(request, user)
                # Y le redireccionamos a la portada
                return redirect('main')

    # Si llegamos al final renderizamos el formulario
    return render(request, "login.html", {'form': form})
    # return render(request, 'login.html', {})

def logon(request):
    # Creamos el formulario de autenticación vacío
    form = UserCreationForm()
    if request.method == "POST":
        # Añadimos los datos recibidos al formulario
        form = UserCreationForm(data=request.POST)
        # Si el formulario es válido...
        if form.is_valid():
            # Creamos la nueva cuenta de usuario
            user = form.save()

            #  Si el usuario se crea correctamente
            if user is not None:
                # Hacemos el login manualmente
                do_login(request, user)
                # Y le redireccionamos a la portada
                return redirect('main')
    
    form.fields('username').help_text = None
    form.fields('password1').help_text = None
    form.fields('password2').help_text = None
    # Si llegamos al final, renderizamos el formulario
    return render(request, "logon.html", {'form': form})
    # return render(request, 'logon.html', {})

def logout(request):
    do_logout(request)
    return render(request, 'home.html', {})

Este es mi models.py:

from django.contrib.auth.models import AbstractUser, BaseUserManager
from django.db import models
from django.utils.translation import ugettext_lazy as _



class UserManager(BaseUserManager):
    """Define a model manager for User model with no username field."""

    use_in_migrations = True

    def _create_user(self, email, password, **extra_fields):
        """Create and save a User with the given email and password."""

        if not email:
            raise ValueError('The given email must be set')
        email = self.normalize_email(email)
        user = self.model(email=email, **extra_fields)
        user.set_password(password)
        user.save(using=self._db)
        return user

    def create_user(self, email, password=None, **extra_fields):
        """Create and save a regular User with the given email and password."""
        extra_fields.setdefault('is_staff', False)
        extra_fields.setdefault('is_superuser', False)
        return self._create_user(email, password, **extra_fields)

    def create_superuser(self, email, password, **extra_fields):
        """Create and save a SuperUser with the given email and password."""
        extra_fields.setdefault('is_staff', True)
        extra_fields.setdefault('is_superuser', True)

        if extra_fields.get('is_staff') is not True:
            raise ValueError('Superuser must have is_staff=True.')
        if extra_fields.get('is_superuser') is not True:
            raise ValueError('Superuser must have is_superuser=True.')

        return self._create_user(email, password, **extra_fields)



class User(AbstractUser):
    """User model."""

    username = None
    email = models.EmailField(_('email address'), unique=True)

    USERNAME_FIELD = 'email'
    REQUIRED_FIELDS = ()

    objects = UserManager()

Y este es mi forms.py:

from django import forms
from .models import User

class UserForm(forms.ModelForm):
    class Meta:
        model = User
        fields = ('first_name', 'last_name', 'email', 'password')
        labels = {'first_name': 'Nombre', 'last_name': 'Apellido', 'email': 'Email', 'password': 'Constraseña'}
        widgets = {
            'first_name': forms.TextInput(attrs={'type': 'text', 'class':'form-control col-6'}),
            'last_name': forms.TextInput(attrs={'type': 'text', 'class': 'form-control col-6'}),
            'email': forms.TextInput(attrs={'type': 'email', 'class': 'form-control col-6'}),
            'password': forms.TextInput(attrs={'type': 'password', 'class': 'form-control col-6'})        
        }

Ya he intentado poner al principio del view lo siguiente, pero no hubo caso

from django.contrib.auth import get_user_model

User = get_user_model()

gracias