Fix User model compatibility shim so it uses the django-provided mechanism

This commit is contained in:
Michael Henson 2013-06-23 14:13:11 -07:00
parent 8d83ff8e6c
commit 363c138ed2

View File

@ -82,11 +82,8 @@ 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
from django.contrib.auth import get_user_model
User = get_user_model()
else:
try:
from django.contrib.auth.models import User