def get_user_model_safe():
 (user_app, user_model) = settings.AUTH_USER_MODEL.split('.')
 try:
  return apps.get_model(user_app, user_model)
 except AppRegistryNotReady:
  if (apps.apps_ready and (not apps.models_ready)):
   app_config = apps.get_app_config(user_app)
   import_module(('%s.%s' % (app_config.name, MODELS_MODULE_NAME)))
   return apps.get_registered_model(user_app, user_model)
  else:
   raise

def get_user_model_safe ( ) : ( user_app , user_model ) = settings . AUTH_USER_MODEL . split ( '.' ) try : return apps . get_model ( user_app , user_model ) except AppRegistryNotReady : if ( apps . apps_ready and ( not apps . models_ready ) ) : app_config = apps . get_app_config ( user_app ) import_module ( ( '%s.%s' % ( app_config . name , MODELS_MODULE_NAME ) ) ) return apps . get_registered_model ( user_app , user_model ) else : raise
fetches the user model using the app registry .