Gelöschtes Gerät einer anderen Organisation gibt den Fingerabdruck frei

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:<id>. Aktive Geräte anderer Organisationen
bleiben weiterhin gesperrt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-25 15:30:37 +01:00
1 parent 9a7b20b6a5
commit a4d9d7e2fe
1 file changed
+14 -1
+14 -1
View File
@@ -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(