From 45e38ddacc5f8d96609ff58cfc32f3c50d560906 Mon Sep 17 00:00:00 2001 From: Asif Saifuddin Auvi Date: Tue, 7 Jun 2016 16:25:56 +0600 Subject: [PATCH] imported and updated to contrib auth User model --- rest_framework/authtoken/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework/authtoken/models.py b/rest_framework/authtoken/models.py index 5e562b135..10c3e6236 100644 --- a/rest_framework/authtoken/models.py +++ b/rest_framework/authtoken/models.py @@ -1,7 +1,7 @@ import binascii import os -from django.conf import AUTH_USER_MODEL +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 _ @@ -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)