Skip to content

Commit

Permalink
feat: Fix static-type issues + adjust tag_object
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuf-musleh committed Apr 21, 2024
1 parent ef6b2a7 commit 4fe4e18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,5 @@ def test_video_block_untagged(self):
{"display_name": "Overview"},
],
"content": {},
# This video has no tags.
}
10 changes: 8 additions & 2 deletions openedx/core/djangoapps/content_tagging/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,17 @@ def set_exported_object_tags(
continue

taxonomy = oel_tagging.get_taxonomy_by_export_id(str(taxonomy_export_id))
tag_object(
oel_tagging.tag_object(
object_id=content_key_str,
taxonomy=taxonomy,
tags=tags_values,
create_invalid=True,
taxonomy_export_id=str(taxonomy_export_id),
)
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:
Expand Down Expand Up @@ -374,6 +378,9 @@ def tag_object(
Replaces the existing ObjectTag entries for the given taxonomy + object_id
with the given list of tags, if the taxonomy can be used by the given object_id.
This is a wrapper around oel_tagging.tag_object that adds emitting the `CONTENT_OBJECT_TAGS_CHANGED` event
when tagging an object.
tags: A list of the values of the tags from this taxonomy to apply.
object_tag_class: Optional. Use a proxy subclass of ObjectTag for additional
Expand All @@ -397,7 +404,6 @@ def tag_object(
content_object=ContentObjectData(object_id=object_id)
)


# Expose the oel_tagging APIs

add_tag_to_taxonomy = oel_tagging.add_tag_to_taxonomy
Expand Down
1 change: 0 additions & 1 deletion requirements/edx/kernel.in
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ openedx-atlas # CLI tool to manage translations
openedx-calc # Library supporting mathematical calculations for Open edX
openedx-django-require
openedx-events # Open edX Events from Hooks Extension Framework (OEP-50)

openedx-filters # Open edX Filters from Hooks Extension Framework (OEP-50)
openedx-learning # Open edX Learning core (experimental)
openedx-mongodbproxy
Expand Down

0 comments on commit 4fe4e18

Please sign in to comment.