From d8541d917ccf9101ec71ffab7a8279e6da551a9e Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 7 Nov 2022 11:25:01 +0100 Subject: [PATCH] fix orohans storage with parents --- scripts/datastorage_orphans.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/datastorage_orphans.py b/scripts/datastorage_orphans.py index 72148e94..46ce382b 100644 --- a/scripts/datastorage_orphans.py +++ b/scripts/datastorage_orphans.py @@ -30,6 +30,9 @@ def clone_device(device): new_device.devicehub_id = old_devicehub_id device.devicehub_id = None new_device.owner = device.owner + if device.parent and device.parent.binding: + new_device.parent = device.parent.binding.device + db.session.add(new_device) placeholder = Placeholder(