From f54e9e2cf23aed3712d31d5b46a725a1692ff7b0 Mon Sep 17 00:00:00 2001
From: Dennis Ahrens <dennis.ahrens@hs-hannover.de>
Date: Fri, 31 Aug 2018 18:01:14 +0200
Subject: [PATCH] If autodiscovery fails on an app that has 'tasks' in his name
 - warning

---
 pikatasks/django_compat.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pikatasks/django_compat.py b/pikatasks/django_compat.py
index ba0fad6..a904041 100644
--- a/pikatasks/django_compat.py
+++ b/pikatasks/django_compat.py
@@ -78,7 +78,11 @@ def autodiscover_tasks(apps=None, modules=("tasks",)):
                 importlib.import_module(full_module_name)
                 # just importing the module is perfectly enough, each task will register itself on import
                 logger.info("Autodiscover: imported \"{0}\"".format(full_module_name))
-            except ImportError:
-                logger.debug("Autodiscover: module \"{0}\" does not exist".format(full_module_name))
+            except ImportError as ie:
+                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
 
-- 
GitLab