From a4d9d7e2fed485df59c12f649b231398b54168dd Mon Sep 17 00:00:00 2001 From: Thomas Stallinger Date: Sun, 25 Oct 2026 15:30:37 +0100 Subject: [PATCH] =?UTF-8?q?Gel=C3=B6schtes=20Ger=C3=A4t=20einer=20anderen?= =?UTF-8?q?=20Organisation=20gibt=20den=20Fingerabdruck=20frei?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Beim Erstkontakt-Probelauf blockierte das in Liebherr archivierte Liebherr-83 die Neuinstallation derselben Hardware für eine neue Organisation. Der alte Datensatz bleibt als Verlauf, sein Fingerabdruck bekommt das Suffix :archiv:. Aktive Geräte anderer Organisationen bleiben weiterhin gesperrt. Co-Authored-By: Claude Opus 5.5 --- app.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 8772da9..90225ee 100644 --- a/app.py +++ b/app.py @@ -491,7 +491,8 @@ def load_or_create_device( device_fingerprint, hostname, created_at, - last_seen + last_seen, + archived_at FROM devices WHERE device_fingerprint = %s """, @@ -500,6 +501,18 @@ def load_or_create_device( row = cur.fetchone() + if row is not None and str(row[1]) != str(organization_id) and row[6] is not None: + # Gefunden beim Erstkontakt-Probelauf (25.10.2026): ein in einer + # anderen Organisation gelöschtes (archiviertes) Gerät blockierte + # die Neuinstallation derselben Hardware für eine neue + # Organisation. Der alte Datensatz bleibt dort als Verlauf, gibt + # aber den Fingerabdruck frei. + cur.execute( + "UPDATE devices SET device_fingerprint = device_fingerprint || ':archiv:' || id::text WHERE id = %s", + (row[0],), + ) + row = None + if row is not None: if str(row[1]) != str(organization_id): raise RuntimeError(