diff --git a/ereuse_devicehub/api/views.py b/ereuse_devicehub/api/views.py index c566be00..23414b38 100644 --- a/ereuse_devicehub/api/views.py +++ b/ereuse_devicehub/api/views.py @@ -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( diff --git a/ereuse_devicehub/resources/action/views/snapshot.py b/ereuse_devicehub/resources/action/views/snapshot.py index 52cb3d5c..b3c4d744 100644 --- a/ereuse_devicehub/resources/action/views/snapshot.py +++ b/ereuse_devicehub/resources/action/views/snapshot.py @@ -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) diff --git a/ereuse_devicehub/resources/device/sync.py b/ereuse_devicehub/resources/device/sync.py index 613f0b39..65731583 100644 --- a/ereuse_devicehub/resources/device/sync.py +++ b/ereuse_devicehub/resources/device/sync.py @@ -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()