fix live view

This commit is contained in:
Cayo Puigdefabregas 2022-11-18 10:20:57 +01:00
parent 9b08c083ce
commit 905716f74b
1 changed files with 4 additions and 1 deletions

View File

@ -142,11 +142,14 @@ class LiveView(View):
return hid return hid
if macs: if macs:
mac = "-{mac}".format(mac=macs[0]) mac = "-{mac}".format(mac=macs[0])
hid += mac # hid += mac
return hid return hid
def live(self, snapshot): def live(self, snapshot):
"""If the device.allocated == True, then this snapshot create an action live.""" """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) hid = self.get_hid(snapshot)
if not hid or not Device.query.filter(Device.hid == hid).count(): if not hid or not Device.query.filter(Device.hid == hid).count():
raise ValidationError('Device not exist.') raise ValidationError('Device not exist.')