diff options
| author | Tom Christie | 2013-12-16 08:59:10 +0000 |
|---|---|---|
| committer | Tom Christie | 2013-12-16 08:59:10 +0000 |
| commit | fc2dee844ab0ca77928f296f13777bf01d94e6fd (patch) | |
| tree | 6c0b96f664be15c802f3cdcc300d157d30748d79 /rest_framework/authtoken/models.py | |
| parent | 69fef838cce33b9079640f83cc03edc30f56f5f1 (diff) | |
| download | django-rest-framework-fc2dee844ab0ca77928f296f13777bf01d94e6fd.tar.bz2 | |
Don't import compat.py from authtoken.models. Closes #1297
Diffstat (limited to 'rest_framework/authtoken/models.py')
| -rw-r--r-- | rest_framework/authtoken/models.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/rest_framework/authtoken/models.py b/rest_framework/authtoken/models.py index 7601f5b7..024f62bf 100644 --- a/rest_framework/authtoken/models.py +++ b/rest_framework/authtoken/models.py @@ -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. |
