#NEWLINE# def get_user_model( ) : #NEWLINE# #INDENT# 'Return the User model that is active in this project' #NEWLINE# from django.conf import settings #NEWLINE# from django.db.models import get_model #NEWLINE# try : #NEWLINE# #INDENT# ( app_label , model_name ) = settings . AUTH_USER_MODEL . split ( '.' ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise ImproperlyConfigured ( "AUTH_USER_MODEL must be of the form 'app_label.model_name'" ) #NEWLINE# #UNINDENT# user_model = get_model ( user_model , model_name ) #NEWLINE# if ( user_model is None ) : #NEWLINE# #INDENT# raise ImproperlyConfigured ( ( "AUTH_USER_MODEL refers to model '%s' that has not been installed" % settings . AUTH_USER_MODEL ) ) #NEWLINE# #UNINDENT# return user_model