mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 01:57:00 +03:00
Don't import compat.py from authtoken.models. Closes #1297
This commit is contained in:
parent
69fef838cc
commit
fc2dee844a
|
@ -1,11 +1,17 @@
|
|||
import uuid
|
||||
import hmac
|
||||
from hashlib import sha1
|
||||
from rest_framework.compat import AUTH_USER_MODEL
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
|
||||
|
||||
# Prior to Django 1.5, the AUTH_USER_MODEL setting does not exist.
|
||||
# Note that we don't perform this code in the compat module due to
|
||||
# bug report #1297
|
||||
# See: https://github.com/tomchristie/django-rest-framework/issues/1297
|
||||
AUTH_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
|
||||
|
||||
|
||||
class Token(models.Model):
|
||||
"""
|
||||
The default authorization token model.
|
||||
|
|
|
@ -104,13 +104,6 @@ def get_concrete_model(model_cls):
|
|||
return model_cls
|
||||
|
||||
|
||||
# Django 1.5 add support for custom auth user model
|
||||
if django.VERSION >= (1, 5):
|
||||
AUTH_USER_MODEL = settings.AUTH_USER_MODEL
|
||||
else:
|
||||
AUTH_USER_MODEL = 'auth.User'
|
||||
|
||||
|
||||
if django.VERSION >= (1, 5):
|
||||
from django.views.generic import View
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue
Block a user