Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
used overridable AUTH_USER_MODEL
  • Loading branch information
auvipy committed Jun 7, 2016
commit f82cf3e65e5e75ca9c918cd40c1d63552cd0b57e
3 changes: 1 addition & 2 deletions rest_framework/authtoken/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import os

from django.conf import settings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need settings to test whether or not the authtoken is in the INSTALLED_APPS.

from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
Expand All @@ -15,7 +14,7 @@ class Token(models.Model):
"""
key = models.CharField(_("Key"), max_length=40, primary_key=True)
user = models.OneToOneField(
User, related_name='auth_token',
settings.AUTH_USER_MODEL, related_name='auth_token',
on_delete=models.CASCADE, verbose_name=_("User")
)
created = models.DateTimeField(_("Created"), auto_now_add=True)
Expand Down