Skip to content
Snippets Groups Projects
Commit f54e9e2c authored by Dennis Ahrens's avatar Dennis Ahrens
Browse files

If autodiscovery fails on an app that has 'tasks' in his name - warning

parent 22f6305b
Branches
Tags
No related merge requests found
...@@ -78,7 +78,11 @@ def autodiscover_tasks(apps=None, modules=("tasks",)): ...@@ -78,7 +78,11 @@ def autodiscover_tasks(apps=None, modules=("tasks",)):
importlib.import_module(full_module_name) importlib.import_module(full_module_name)
# just importing the module is perfectly enough, each task will register itself on import # just importing the module is perfectly enough, each task will register itself on import
logger.info("Autodiscover: imported \"{0}\"".format(full_module_name)) logger.info("Autodiscover: imported \"{0}\"".format(full_module_name))
except ImportError: except ImportError as ie:
logger.debug("Autodiscover: module \"{0}\" does not exist".format(full_module_name)) msg = "Autodiscover: module \"{0}\" does not exist: {1}".format(full_module_name, str(ie))
if 'tasks' in app_name:
logger.warning(msg)
else:
logger.debug(msg)
return utils.all_tasks return utils.all_tasks
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment