diff options
| author | Tom Christie | 2013-06-26 17:56:42 +0100 | 
|---|---|---|
| committer | Tom Christie | 2013-06-26 17:56:42 +0100 | 
| commit | 715bd47dfababd39be9b3295ada99f2107d7c00c (patch) | |
| tree | 6ca416aa106f0d2737438e9983590ebeb44b5036 /rest_framework/compat.py | |
| parent | 13a3c993ab20e7af510d615a5eafaa87667b8efb (diff) | |
| download | django-rest-framework-715bd47dfababd39be9b3295ada99f2107d7c00c.tar.bz2 | |
Use AUTH_USER_MODEL consistently between various Django versions. Closes #946
Diffstat (limited to 'rest_framework/compat.py')
| -rw-r--r-- | rest_framework/compat.py | 10 | 
1 files changed, 2 insertions, 8 deletions
| diff --git a/rest_framework/compat.py b/rest_framework/compat.py index a19bd778..69853730 100644 --- a/rest_framework/compat.py +++ b/rest_framework/compat.py @@ -83,15 +83,9 @@ def get_concrete_model(model_cls):  # Django 1.5 add support for custom auth user model  if django.VERSION >= (1, 5):      from django.conf import settings -    if hasattr(settings, 'AUTH_USER_MODEL'): -        User = settings.AUTH_USER_MODEL -    else: -        from django.contrib.auth.models import User +    AUTH_USER_MODEL = settings.AUTH_USER_MODEL  else: -    try: -        from django.contrib.auth.models import User -    except ImportError: -        raise ImportError("User model is not to be found.") +    AUTH_USER_MODEL = 'auth.User'  if django.VERSION >= (1, 5): | 
