add always response 201
This commit is contained in:
parent
7c0b3c190c
commit
9f948df209
|
@ -53,7 +53,14 @@ class InventoryView(LoginMix, SnapshotMix):
|
||||||
snapshot_json = self.validate(snapshot_json)
|
snapshot_json = self.validate(snapshot_json)
|
||||||
try:
|
try:
|
||||||
self.snapshot_json = ParseSnapshotLsHw(snapshot_json).get_snapshot()
|
self.snapshot_json = ParseSnapshotLsHw(snapshot_json).get_snapshot()
|
||||||
except ValidationError:
|
except Exception as err:
|
||||||
|
txt = "{}, {}".format(err.__class__, err)
|
||||||
|
uuid = snapshot_json.get('uuid')
|
||||||
|
wbid = snapshot_json.get('wbid')
|
||||||
|
error = SnapshotErrors(
|
||||||
|
description=txt, snapshot_uuid=uuid, severity=Severity.Error, wbid=wbid
|
||||||
|
)
|
||||||
|
error.save(commit=True)
|
||||||
self.response = jsonify('')
|
self.response = jsonify('')
|
||||||
self.response.status_code = 201
|
self.response.status_code = 201
|
||||||
return self.response
|
return self.response
|
||||||
|
|
Reference in a new issue