mirror of
https://github.com/jazzband/django-authority.git
synced 2026-04-06 08:11:00 +00:00
14 lines
548 B
Python
14 lines
548 B
Python
from django.conf import settings
|
|
|
|
|
|
# Django 1.5 compatibility utilities, providing support for custom User models.
|
|
# Since get_user_model() causes a circular import if called when app models are
|
|
# being loaded, the user_model_label should be used when possible, with calls
|
|
# to get_user_model deferred to execution time
|
|
user_model_label = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
|
|
|
|
try:
|
|
from django.contrib.auth import get_user_model
|
|
except ImportError:
|
|
from django.contrib.auth.models import User
|
|
get_user_model = lambda: User
|