Skip to content

Commit f20ba93

Browse files
committed
Refactor HDASerializer to simplify copied_from_ldda_id serialization
1 parent a6dcc86 commit f20ba93

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

lib/galaxy/managers/hdas.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -576,15 +576,6 @@ def __init__(self, app: StructuredApp):
576576
["accessible", "id", "name", "history_id", "hid", "history_content_type", "state", "deleted", "visible"],
577577
)
578578

579-
def serialize_copied_from_ldda_id(self, item, key, **context):
580-
"""
581-
Serialize an id attribute of `item`.
582-
"""
583-
copied_from_ldda_id = item.copied_from_library_dataset_dataset_association
584-
if copied_from_ldda_id is not None:
585-
return self.serialize_id(copied_from_ldda_id, "id", **context)
586-
return None
587-
588579
def add_serializers(self):
589580
super().add_serializers()
590581
taggable.TaggableSerializerMixin.add_serializers(self)
@@ -596,7 +587,7 @@ def add_serializers(self):
596587
"history_content_type": lambda item, key, **context: "dataset",
597588
"hda_ldda": lambda item, key, **context: "hda",
598589
"type_id": self.serialize_type_id,
599-
"copied_from_ldda_id": self.serialize_copied_from_ldda_id,
590+
"copied_from_ldda_id": lambda item, key, **context: item.copied_from_library_dataset_dataset_association_id,
600591
"history_id": self.serialize_id,
601592
# remapped
602593
"misc_info": self._remap_from("info"),

0 commit comments

Comments
 (0)