From 6ef2d8795d43b0f6b948ba9b0b389ab228207823 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Tue, 26 Apr 2022 10:43:58 +0200 Subject: [PATCH] clean try exception --- ereuse_devicehub/api/views.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/ereuse_devicehub/api/views.py b/ereuse_devicehub/api/views.py index b8db0684..3516c79e 100644 --- a/ereuse_devicehub/api/views.py +++ b/ereuse_devicehub/api/views.py @@ -54,19 +54,8 @@ class InventoryView(LoginMix, SnapshotMix): snapshot_json = self.validate(snapshot_json) if type(snapshot_json) == Response: return snapshot_json - try: - self.snapshot_json = ParseSnapshotLsHw(snapshot_json).get_snapshot() - except Exception as err: - txt = "{}, {}".format(err.__class__, err) - uuid = snapshot_json.get('uuid') - sid = snapshot_json.get('sid') - error = SnapshotErrors( - description=txt, snapshot_uuid=uuid, severity=Severity.Error, sid=sid - ) - error.save(commit=True) - self.response = jsonify('') - self.response.status_code = 201 - return self.response + + self.snapshot_json = ParseSnapshotLsHw(snapshot_json).get_snapshot() snapshot = self.build() db.session.add(snapshot)