Skip to content

Commit

Permalink
fix: do not delete tags on soft-deleting components
Browse files Browse the repository at this point in the history
This helps us to restore the tags on restoring the component
  • Loading branch information
navinkarkera committed Dec 13, 2024
1 parent 795ecbf commit 29eed07
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions openedx/core/djangoapps/content_tagging/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,6 @@ def auto_tag_library_block(**kwargs):
)


@receiver(LIBRARY_BLOCK_DELETED)
def delete_tag_library_block(**kwargs):
"""
Delete tags associated with a Library XBlock whenever the block is deleted.
"""
library_block_data = kwargs.get("library_block", None)
if not library_block_data or not isinstance(library_block_data, LibraryBlockData):
log.error("Received null or incorrect data for event")
return

try:
delete_library_block_tags(str(library_block_data.usage_key))
except Exception as err: # pylint: disable=broad-except
log.error(f"Failed to delete library block tags: {err}")


@receiver(XBLOCK_DUPLICATED)
def duplicate_tags(**kwargs):
"""
Expand Down

0 comments on commit 29eed07

Please sign in to comment.