Closes #17048: Replace all calls to get_user_model() with direct imports of User

This commit is contained in:
Jeremy Stretch
2024-07-31 16:45:07 -04:00
parent 108b8be226
commit c99030565d
37 changed files with 79 additions and 132 deletions

View File

@@ -1,4 +1,3 @@
from django.contrib.auth import get_user_model
from django.db import models
from django.utils.translation import gettext_lazy as _
@@ -15,7 +14,7 @@ class UserConfig(models.Model):
This model stores arbitrary user-specific preferences in a JSON data structure.
"""
user = models.OneToOneField(
to=get_user_model(),
to='users.User',
on_delete=models.CASCADE,
related_name='config'
)

View File

@@ -2,7 +2,6 @@ import binascii
import os
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.postgres.fields import ArrayField
from django.core.validators import MinLengthValidator
from django.db import models
@@ -25,7 +24,7 @@ class Token(models.Model):
It also supports setting an expiration time and toggling write ability.
"""
user = models.ForeignKey(
to=get_user_model(),
to='users.User',
on_delete=models.CASCADE,
related_name='tokens'
)