used overridable AUTH_USER_MODEL

This commit is contained in:
Asif Saifuddin Auvi 2016-06-07 17:01:52 +06:00
parent 2c0bcc6275
commit f82cf3e65e

View File

@ -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)