From 905716f74bbeba82b407445f46bf48444dec8c60 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 18 Nov 2022 10:20:57 +0100 Subject: [PATCH] fix live view --- ereuse_devicehub/resources/action/views/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/resources/action/views/views.py b/ereuse_devicehub/resources/action/views/views.py index afbeb665..25814b4a 100644 --- a/ereuse_devicehub/resources/action/views/views.py +++ b/ereuse_devicehub/resources/action/views/views.py @@ -142,11 +142,14 @@ class LiveView(View): return hid if macs: mac = "-{mac}".format(mac=macs[0]) - hid += mac + # hid += mac return hid def live(self, snapshot): """If the device.allocated == True, then this snapshot create an action live.""" + for c in snapshot['components']: + c.parent = snapshot['device'] + snapshot['device'].set_hid() hid = self.get_hid(snapshot) if not hid or not Device.query.filter(Device.hid == hid).count(): raise ValidationError('Device not exist.')