mirror of
https://github.com/jazzband/django-authority.git
synced 2026-03-16 22:20:28 +00:00
16 lines
561 B
Python
16 lines
561 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
|
|
|
|
def get_user_model():
|
|
return User
|