Skip to content

Commit da9f510

Browse files
committed
fix: Bugs sending LIBRARY_CONTAINER_UPDATED signal
1 parent 1d94788 commit da9f510

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

openedx/core/djangoapps/content_libraries/api/libraries.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ def set_library_block_olx(usage_key: LibraryUsageLocatorV2, new_olx_str: str) ->
911911
LIBRARY_CONTAINER_UPDATED.send_event(
912912
library_container=LibraryContainerData(
913913
library_key=usage_key.lib_key,
914-
container_key=container.container_pk,
914+
container_key=str(container.container_key),
915915
background=True,
916916
)
917917
)
@@ -1252,7 +1252,7 @@ def delete_library_block(usage_key: LibraryUsageLocatorV2, remove_from_parent=Tr
12521252
LIBRARY_CONTAINER_UPDATED.send_event(
12531253
library_container=LibraryContainerData(
12541254
library_key=library_key,
1255-
container_key=container.container_pk,
1255+
container_key=str(container.container_key),
12561256
background=True,
12571257
)
12581258
)

openedx/core/djangoapps/content_libraries/library_context.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def send_container_updated_events(self, usage_key: UsageKeyV2):
126126
LIBRARY_CONTAINER_UPDATED.send_event(
127127
library_container=LibraryContainerData(
128128
library_key=usage_key.lib_key,
129-
container_key=container.container_pk,
129+
container_key=str(container.container_key),
130130
background=True,
131131
)
132132
)

openedx/core/djangoapps/content_libraries/tests/test_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,7 @@ def _validate_calls_of_html_block(self, event_mock):
820820
"sender": None,
821821
"library_container": LibraryContainerData(
822822
library_key=self.lib1.library_key,
823-
container_key=self.unit1.container_pk,
823+
container_key=str(self.unit1.container_key),
824824
background=True,
825825
)
826826
},
@@ -832,7 +832,7 @@ def _validate_calls_of_html_block(self, event_mock):
832832
"sender": None,
833833
"library_container": LibraryContainerData(
834834
library_key=self.lib1.library_key,
835-
container_key=self.unit2.container_pk,
835+
container_key=str(self.unit2.container_key),
836836
background=True,
837837
)
838838
},

0 commit comments

Comments
 (0)