fix device set_hid
This commit is contained in:
parent
81b28b2663
commit
f0ffe27671
|
@ -58,6 +58,8 @@ class InventoryView(LoginMixin, SnapshotMixin):
|
|||
self.snapshot_json = ParseSnapshotLsHw(snapshot_json).get_snapshot()
|
||||
|
||||
snapshot = self.build()
|
||||
snapshot.device.set_hid()
|
||||
snapshot.device.binding.device.set_hid()
|
||||
db.session.add(snapshot)
|
||||
|
||||
snap_log = SnapshotsLog(
|
||||
|
|
|
@ -219,6 +219,8 @@ class SnapshotView(SnapshotMixin):
|
|||
try:
|
||||
self.snapshot_json = resource_def.schema.load(snapshot_json)
|
||||
snapshot = self.build()
|
||||
snapshot.device.set_hid()
|
||||
snapshot.device.binding.device.set_hid()
|
||||
except Exception as err:
|
||||
txt = "{}".format(err)
|
||||
self.errors(txt=txt, commit=True)
|
||||
|
|
|
@ -86,6 +86,7 @@ class Sync:
|
|||
if motherboard:
|
||||
for c in db_device.components:
|
||||
if c.type == "Motherboard" and motherboard.hid != c.hid:
|
||||
# import pdb; pdb.set_trace()
|
||||
raise ValidationError(err_motherboard)
|
||||
|
||||
db_components, actions = OrderedSet(), OrderedSet()
|
||||
|
|
Reference in New Issue