Skip to content

Commit

Permalink
serialize after commit in create datasets from library folder
Browse files Browse the repository at this point in the history
  • Loading branch information
arash77 committed Oct 10, 2024
1 parent 46cbd11 commit 5e924cc
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/galaxy/webapps/galaxy/services/history_contents.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,24 +1172,28 @@ def traverse(folder):
rval.append(ld)
return rval

for ld in traverse(folder):
hda = ld.library_dataset_dataset_association.to_history_dataset_association(
hdas = [
ld.library_dataset_dataset_association.to_history_dataset_association(
history, add_to_history=True, flush=False
)
for ld in traverse(folder)
]
history.add_pending_items()

with transaction(trans.sa_session):
trans.sa_session.commit()

for hda in hdas:
hda_dict = self.hda_serializer.serialize_to_view(
hda, user=trans.user, trans=trans, encode_id=False, **serialization_params.model_dump()
)
rval.append(hda_dict)
history.add_pending_items()
return rval

else:
message = f"Invalid 'source' parameter in request: {source}"
raise exceptions.RequestParameterInvalidException(message)

with transaction(trans.sa_session):
trans.sa_session.commit()
return rval

def __create_dataset(
self,
trans,
Expand Down

0 comments on commit 5e924cc

Please sign in to comment.