Skip to content

Commit

Permalink
removed AUTH_USER_MODEL compat property (#4176)
Browse files Browse the repository at this point in the history
Removed unnecessary `AUTH_USER_MODEL` compat variable.

(No longer required)
  • Loading branch information
auvipy authored and tomchristie committed Jun 7, 2016
1 parent b1035b2 commit 04e5b5b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions rest_framework/authtoken/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,17 @@
from django.utils.encoding import python_2_unicode_compatible
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
class Token(models.Model):
"""
The default authorization token model.
"""
key = models.CharField(_("Key"), max_length=40, primary_key=True)
user = models.OneToOneField(AUTH_USER_MODEL, related_name='auth_token',
on_delete=models.CASCADE, verbose_name=_("User"))
user = models.OneToOneField(
settings.AUTH_USER_MODEL, related_name='auth_token',
on_delete=models.CASCADE, verbose_name=_("User")
)
created = models.DateTimeField(_("Created"), auto_now_add=True)

class Meta:
Expand Down

0 comments on commit 04e5b5b

Please sign in to comment.