From 17f1ff98e7d623a8b8d61c5f480608c0eb97e3e3 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 11 Nov 2020 16:53:41 +0100 Subject: [PATCH] adding update hid when insert one manual or automatic snapshot --- ereuse_devicehub/resources/device/sync.py | 2 ++ ereuse_devicehub/resources/device/views.py | 1 + 2 files changed, 3 insertions(+) diff --git a/ereuse_devicehub/resources/device/sync.py b/ereuse_devicehub/resources/device/sync.py index 5f13d5a0..4efa67bc 100644 --- a/ereuse_devicehub/resources/device/sync.py +++ b/ereuse_devicehub/resources/device/sync.py @@ -52,6 +52,7 @@ class Sync: of the passed-in components. 2. A list of Add / Remove (not yet added to session). """ + db_device = self.execute_register(device) db_components, actions = OrderedSet(), OrderedSet() if components is not None: # We have component info (see above) @@ -71,6 +72,7 @@ class Sync: # We only want to perform Add/Remove to not new components actions = self.add_remove(db_device, not_new_components) db_device.components = db_components + db_device.add_mac_to_hid() return db_device, actions def execute_register_component(self, diff --git a/ereuse_devicehub/resources/device/views.py b/ereuse_devicehub/resources/device/views.py index 8f16b12d..1b87a426 100644 --- a/ereuse_devicehub/resources/device/views.py +++ b/ereuse_devicehub/resources/device/views.py @@ -230,6 +230,7 @@ class DeviceMergeView(View): base_device.manufacturer = latest_snapshot_device.manufacturer base_device.model = latest_snapshot_device.model base_device.chassis = latest_snapshot_device.chassis + base_device.add_mac_to_hid() class ManufacturerView(View):