fix uuid in device not computer

This commit is contained in:
Cayo Puigdefabregas 2022-06-14 10:46:21 +02:00
parent 309b0f9354
commit 86446a268c
1 changed files with 4 additions and 2 deletions

View File

@ -118,7 +118,7 @@ class SnapshotMixin:
return snapshot return snapshot
def get_uuid(self, debug): def get_uuid(self, debug):
if not debug: if not debug or not isinstance(debug, dict):
self.errors(txt="There is not uuid") self.errors(txt="There is not uuid")
return return
@ -167,7 +167,9 @@ class SnapshotView(SnapshotMixin):
self.version = snapshot_json.get('version') self.version = snapshot_json.get('version')
self.uuid = snapshot_json.get('uuid') self.uuid = snapshot_json.get('uuid')
self.sid = None self.sid = None
self.get_uuid(snapshot_json.pop('debug', None)) system_uuid = self.get_uuid(snapshot_json.pop('debug', None))
if system_uuid:
snapshot_json['device']['uuid'] = system_uuid
try: try:
self.snapshot_json = resource_def.schema.load(snapshot_json) self.snapshot_json = resource_def.schema.load(snapshot_json)