From cf5357554c537f674c4c6c1162f4072d6fbe39c2 Mon Sep 17 00:00:00 2001
From: Alex Wiens <alex.wiens@uni-paderborn.de>
Date: Mon, 21 Apr 2025 22:31:39 +0200
Subject: [PATCH] prule.daemon: Add workaround tag api

---
 prule/daemon/__main__.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/prule/daemon/__main__.py b/prule/daemon/__main__.py
index c450e86..56074a9 100644
--- a/prule/daemon/__main__.py
+++ b/prule/daemon/__main__.py
@@ -612,6 +612,8 @@ class PruleThread(threading.Thread):
                 return (False, 401)
             if e.code == 500 and "Duplicate entry" in msg: # TODO: Tag is inserted twice. Fix once tag removal is possible.
                 return (True, 0)
+            if e.code == 500 and "UNIQUE constraint failed: jobtag.job_id, jobtag.tag_id" in msg: # TODO: Tag is inserted twice. Fix once tag removal is possible.
+                return (True, 0)
             return (False, e.code if e.code > 0 else 999)
         except Exception as e: # something went horribly wrong
             traceback.print_exc()
-- 
GitLab