Skip to content

Commit bba63b3

Browse files
committed
admin: spears: Don't add suites to migration source twice
1 parent 6fc555c commit bba63b3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/lkadmin/spears.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def _add_migration_task(repo_name: str, source_suites: T.List[str], target_suite
5151
stask.target_suite = target_suite_e
5252

5353
for suite_name in source_suites:
54-
stask.source_suites.append(session.query(ArchiveSuite).filter(ArchiveSuite.name == suite_name).one())
54+
suite = session.query(ArchiveSuite).filter(ArchiveSuite.name == suite_name).one()
55+
if suite not in stask.source_suites:
56+
stask.source_suites.append(suite)
5557

5658
stask.delays = {}
5759
for prio_name, days in delays.items():

0 commit comments

Comments
 (0)