From 69fb6cee1f3937a382ed63e847618a77ffb46add Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:41:42 +0200 Subject: [PATCH] fix comments used before assigned --- lib/galaxy/model/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/galaxy/model/__init__.py b/lib/galaxy/model/__init__.py index d592f9308bfa..40a8d414f8c9 100644 --- a/lib/galaxy/model/__init__.py +++ b/lib/galaxy/model/__init__.py @@ -7708,12 +7708,9 @@ def copy(self, user=None): old_step.copy_to(new_step, step_mapping, user=user) copied_workflow.steps = copied_steps - copied_comments = [] - for comment in self.comments: - copied_comments.append(comment.copy()) - + copied_comments = [comment.copy() for comment in self.comments] steps_by_id = {s.order_index: s for s in copied_workflow.steps} - comments_by_id = {c.order_index: c for c in copied_workflow.comments} + comments_by_id = {c.order_index: c for c in copied_comments} # copy comment relationships for old_comment, new_comment in zip(self.comments, copied_comments):