fixing bugs
This commit is contained in:
parent
09d92e818c
commit
14e974781e
|
@ -244,11 +244,15 @@ class ActionView(View):
|
||||||
components = snapshot.get('components')
|
components = snapshot.get('components')
|
||||||
if not device:
|
if not device:
|
||||||
return None
|
return None
|
||||||
|
if not components:
|
||||||
|
return device.hid
|
||||||
macs = [c.serial_number for c in components
|
macs = [c.serial_number for c in components
|
||||||
if c.type == 'NetworkAdapter' and c.serial_number is not None]
|
if c.type == 'NetworkAdapter' and c.serial_number is not None]
|
||||||
macs.sort()
|
macs.sort()
|
||||||
mac = ''
|
mac = ''
|
||||||
hid = device.hid
|
hid = device.hid
|
||||||
|
if not hid:
|
||||||
|
return hid
|
||||||
if macs:
|
if macs:
|
||||||
mac = "-{mac}".format(mac=macs[0])
|
mac = "-{mac}".format(mac=macs[0])
|
||||||
hid += mac
|
hid += mac
|
||||||
|
|
Reference in a new issue