feat: Serialize tag data in OLX for blocks (#34145)

This commit is contained in:
Yusuf Musleh
2024-02-14 21:30:23 +03:00
committed by GitHub
parent 5a36fa9163
commit 6e0bc66a77
10 changed files with 475 additions and 5 deletions

View File

@@ -428,6 +428,8 @@ class XmlMixin:
"""
For exporting, set data on `node` from ourselves.
"""
# Importing here to avoid circular import
from cms.lib.xblock.tagging.tagged_block_mixin import TaggedBlockMixin
# Get the definition
xml_object = self.definition_to_xml(self.runtime.export_fs)
@@ -498,6 +500,10 @@ class XmlMixin:
node.set('org', self.location.org)
node.set('course', self.location.course)
# Serialize and add tag data if any
if isinstance(self, TaggedBlockMixin):
self.add_tags_to_node(node)
def definition_to_xml(self, resource_fs):
"""
Return a new etree Element object created from this modules definition.