mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
removed AUTH_USER_MODEL compat property (#4176)
Removed unnecessary `AUTH_USER_MODEL` compat variable. (No longer required)
This commit is contained in:
parent
b1035b2a87
commit
04e5b5b20a
|
@ -6,12 +6,6 @@ from django.db import models
|
||||||
from django.utils.encoding import python_2_unicode_compatible
|
from django.utils.encoding import python_2_unicode_compatible
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
# Prior to Django 1.5, the AUTH_USER_MODEL setting does not exist.
|
|
||||||
# Note that we don't perform this code in the compat module due to
|
|
||||||
# bug report #1297
|
|
||||||
# See: https://github.com/tomchristie/django-rest-framework/issues/1297
|
|
||||||
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
|
|
||||||
|
|
||||||
|
|
||||||
@python_2_unicode_compatible
|
@python_2_unicode_compatible
|
||||||
class Token(models.Model):
|
class Token(models.Model):
|
||||||
|
@ -19,8 +13,10 @@ class Token(models.Model):
|
||||||
The default authorization token model.
|
The default authorization token model.
|
||||||
"""
|
"""
|
||||||
key = models.CharField(_("Key"), max_length=40, primary_key=True)
|
key = models.CharField(_("Key"), max_length=40, primary_key=True)
|
||||||
user = models.OneToOneField(AUTH_USER_MODEL, related_name='auth_token',
|
user = models.OneToOneField(
|
||||||
on_delete=models.CASCADE, verbose_name=_("User"))
|
settings.AUTH_USER_MODEL, related_name='auth_token',
|
||||||
|
on_delete=models.CASCADE, verbose_name=_("User")
|
||||||
|
)
|
||||||
created = models.DateTimeField(_("Created"), auto_now_add=True)
|
created = models.DateTimeField(_("Created"), auto_now_add=True)
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user