diff --git a/openedx/core/djangoapps/content_tagging/api.py b/openedx/core/djangoapps/content_tagging/api.py index 80de81958abc..b63c70c5f0b8 100644 --- a/openedx/core/djangoapps/content_tagging/api.py +++ b/openedx/core/djangoapps/content_tagging/api.py @@ -18,8 +18,11 @@ from openedx_tagging.core.tagging.models.utils import TAGS_CSV_SEPARATOR from organizations.models import Organization from .helpers.objecttag_export_helpers import build_object_tree_with_objecttags, iterate_with_level -from openedx_events.content_authoring.data import ContentObjectChangedData -from openedx_events.content_authoring.signals import CONTENT_OBJECT_ASSOCIATIONS_CHANGED +from openedx_events.content_authoring.data import ContentObjectData, ContentObjectChangedData +from openedx_events.content_authoring.signals import ( + CONTENT_OBJECT_ASSOCIATIONS_CHANGED, + CONTENT_OBJECT_TAGS_CHANGED, +) from .models import TaxonomyOrg from .types import ContentKey, TagValuesByObjectIdDict, TagValuesByTaxonomyIdDict, TaxonomyDict @@ -301,6 +304,7 @@ def set_exported_object_tags( create_invalid=True, taxonomy_export_id=str(taxonomy_export_id), ) + CONTENT_OBJECT_ASSOCIATIONS_CHANGED.send_event( time=now(), content_object=ContentObjectChangedData( @@ -309,6 +313,12 @@ def set_exported_object_tags( ) ) + # Emit a (deprecated) CONTENT_OBJECT_TAGS_CHANGED event too + CONTENT_OBJECT_TAGS_CHANGED.send_event( + time=now(), + content_object=ContentObjectData(object_id=content_key_str) + ) + def import_course_tags_from_csv(csv_path, course_id) -> None: """ @@ -410,6 +420,12 @@ def tag_object( ) ) + # Emit a (deprecated) CONTENT_OBJECT_TAGS_CHANGED event too + CONTENT_OBJECT_TAGS_CHANGED.send_event( + time=now(), + content_object=ContentObjectData(object_id=object_id) + ) + # Expose the oel_tagging APIs add_tag_to_taxonomy = oel_tagging.add_tag_to_taxonomy