From 762b4fdf7fb0a35161597679b18bb864748d0dc0 Mon Sep 17 00:00:00 2001 From: Kyle McCormick Date: Mon, 26 Oct 2020 15:13:22 -0400 Subject: [PATCH] Use AppConfig in instuctor_task app to ensure tasks are discovered This fixes an issue where instructor_task Celery tasks were not being auto-discovered, thus leaving them unregistered and unable to be completed by our Celery workers. TNL-7652 --- lms/djangoapps/instructor_task/__init__.py | 2 ++ lms/djangoapps/instructor_task/apps.py | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 lms/djangoapps/instructor_task/apps.py diff --git a/lms/djangoapps/instructor_task/__init__.py b/lms/djangoapps/instructor_task/__init__.py index e69de29bb2..6f2eba3c8b 100644 --- a/lms/djangoapps/instructor_task/__init__.py +++ b/lms/djangoapps/instructor_task/__init__.py @@ -0,0 +1,2 @@ +# pylint: disable=missing-module-docstring +default_app_config = 'lms.djangoapps.instructor_task.apps.InstructorTaskConfig' diff --git a/lms/djangoapps/instructor_task/apps.py b/lms/djangoapps/instructor_task/apps.py new file mode 100644 index 0000000000..f5454bb989 --- /dev/null +++ b/lms/djangoapps/instructor_task/apps.py @@ -0,0 +1,16 @@ +""" +Instructor Task Application Configuration +""" + +from django.apps import AppConfig + + +class InstructorTaskConfig(AppConfig): + """ + Application Configuration for Instructor Task + """ + name = u'lms.djangoapps.instructor_task' + + def ready(self): + # noinspection PyUnresolvedReferences + from . import tasks # pylint: disable=unused-import