Skip to content

Commit

Permalink
DMED-119 - refactor Uploader class to handle cases where multiple nod…
Browse files Browse the repository at this point in the history
…es with the same replication source ID are found
  • Loading branch information
bergatco committed Sep 25, 2024
1 parent 106f281 commit aad1615
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion schulcloud/h5p/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@ def collection_status(self, collection: Collection, collection_node: Node):
filename = os.path.basename(child.filepath)
name = os.path.splitext(filename)[0]
rep_source_id = create_replicationsourceid(name)
node_exists = self.api.find_node_by_replication_source_id(rep_source_id, skip_exception=True)
try:
node_exists = self.api.find_node_by_replication_source_id(rep_source_id, skip_exception=True)
except FoundTooManyException:
return "too_many"
if not node_exists:
if uploaded_nodes == 0:
return "missing"
Expand Down

0 comments on commit aad1615

Please sign in to comment.