Skip to content

Commit 2e03a8e

Browse files
committed
fix: Send the course publish signal on course import.
1 parent 83bbc64 commit 2e03a8e

File tree

1 file changed

+5
-1
lines changed
  • cms/djangoapps/contentstore/management/commands

1 file changed

+5
-1
lines changed

cms/djangoapps/contentstore/management/commands/import.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from openedx.core.djangoapps.django_comment_common.utils import are_permissions_roles_seeded, seed_permissions_roles
99
from xmodule.contentstore.django import contentstore # lint-amnesty, pylint: disable=wrong-import-order
1010
from xmodule.modulestore import ModuleStoreEnum # lint-amnesty, pylint: disable=wrong-import-order
11-
from xmodule.modulestore.django import modulestore # lint-amnesty, pylint: disable=wrong-import-order
11+
from xmodule.modulestore.django import SignalHandler, modulestore # lint-amnesty, pylint: disable=wrong-import-order
1212
from xmodule.modulestore.xml_importer import import_course_from_xml # lint-amnesty, pylint: disable=wrong-import-order
1313
from xmodule.util.sandboxing import DEFAULT_PYTHON_LIB_FILENAME # lint-amnesty, pylint: disable=wrong-import-order
1414

@@ -73,6 +73,10 @@ def handle(self, *args, **options):
7373

7474
for course in course_items:
7575
course_id = course.id
76+
# Importing is an act of publishing so send the course published signal.
77+
SignalHandler.course_published.send_robust(sender=self, course_key=course_id)
78+
79+
# Seed forum permission roles if we need to.
7680
if not are_permissions_roles_seeded(course_id):
7781
self.stdout.write(f'Seeding forum roles for course {course_id}\n')
7882
seed_permissions_roles(course_id)

0 commit comments

Comments
 (0)