From 984c1aeb211bcf7daefcaecdd2435889c4063043 Mon Sep 17 00:00:00 2001 From: Alexey Kartashov Date: Mon, 16 Dec 2024 14:49:39 +0100 Subject: [PATCH] fix(sct/testrun): Check for duplicate entries on log submit Fixes #532 --- argus/backend/plugins/sct/testrun.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/argus/backend/plugins/sct/testrun.py b/argus/backend/plugins/sct/testrun.py index 89b75b98..14ab5a9d 100644 --- a/argus/backend/plugins/sct/testrun.py +++ b/argus/backend/plugins/sct/testrun.py @@ -225,6 +225,11 @@ def finish_run(self, payload: dict = None): def submit_logs(self, logs: list[dict]): for log in logs: + try: + next(existing for existing in self.logs if existing[0] == log["log_name"]) + raise Exception(f"Log {log['log_name']} already exists!", log["log_name"]) + except StopIteration: + pass self.logs.append((log["log_name"], log["log_link"])) def add_screenshot(self, screenshot_link: str):