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
Next Next commit
imported and updated to contrib auth User model
  • Loading branch information
auvipy committed Jun 7, 2016
commit 45e38ddacc5f8d96609ff58cfc32f3c50d560906
4 changes: 2 additions & 2 deletions rest_framework/authtoken/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import binascii
import os

from django.conf import AUTH_USER_MODEL
from django.contrib.auth.models import User
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this remove the ability to use a custom user ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

then should stick with AUTH_USER_MODEL instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes.

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