fix circular imports

This commit is contained in:
Cayo Puigdefabregas 2022-05-20 18:30:43 +02:00
parent 1a8dc80067
commit a486486995

View file

@ -11,7 +11,6 @@ from marshmallow import ValidationError
from sqlalchemy.util import OrderedSet from sqlalchemy.util import OrderedSet
from ereuse_devicehub.db import db from ereuse_devicehub.db import db
from ereuse_devicehub.parser.models import SnapshotsLog
from ereuse_devicehub.resources.action.models import Snapshot from ereuse_devicehub.resources.action.models import Snapshot
from ereuse_devicehub.resources.device.models import Computer from ereuse_devicehub.resources.device.models import Computer
from ereuse_devicehub.resources.device.sync import Sync from ereuse_devicehub.resources.device.sync import Sync
@ -138,6 +137,7 @@ class SnapshotView(SnapshotMixin):
try: try:
self.snapshot_json = resource_def.schema.load(snapshot_json) self.snapshot_json = resource_def.schema.load(snapshot_json)
except ValidationError as err: except ValidationError as err:
from ereuse_devicehub.parser.models import SnapshotsLog
txt = "{}".format(err) txt = "{}".format(err)
uuid = snapshot_json.get('uuid') uuid = snapshot_json.get('uuid')
error = SnapshotsLog( error = SnapshotsLog(