mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 22:04:48 +03:00
used overridable AUTH_USER_MODEL
This commit is contained in:
parent
2c0bcc6275
commit
f82cf3e65e
|
@ -2,7 +2,6 @@ import binascii
|
|||
import os
|
||||
|
||||
from django.conf import settings
|
||||
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 _
|
||||
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user