User settings.AUTH_USER_MODEL instead of User in models

This commit is contained in:
Edgar P. Burkhart 2022-12-29 20:05:25 +01:00
parent 7bb6b2f671
commit e26f552aff
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227

View file

@ -2,7 +2,7 @@ import pathlib
import uuid import uuid
from datetime import date from datetime import date
from django.contrib.auth.models import User from django.conf import settings
from django.core.validators import FileExtensionValidator from django.core.validators import FileExtensionValidator
from django.db import models from django.db import models
from django.forms import ModelForm from django.forms import ModelForm
@ -12,7 +12,7 @@ from django.utils.translation import gettext as _
class UserModel(models.Model): class UserModel(models.Model):
user = models.ForeignKey( user = models.ForeignKey(
User, on_delete=models.CASCADE, verbose_name=_("User"), editable=False settings.AUTH_USER_MODEL, on_delete=models.CASCADE, verbose_name=_("User"), editable=False
) )
class Meta: class Meta: