fix wbid bug

This commit is contained in:
Cayo Puigdefabregas 2022-04-12 11:13:08 +02:00
parent 089dc92d62
commit c8b11cf505
2 changed files with 5 additions and 2 deletions

View File

@ -264,8 +264,12 @@ class UploadSnapshotForm(FlaskForm, SnapshotMix):
except ValidationError as err: except ValidationError as err:
txt = "{}".format(err) txt = "{}".format(err)
uuid = snapshot_json.get('uuid') uuid = snapshot_json.get('uuid')
wbid = snapshot_json.get('wbid')
error = SnapshotErrors( error = SnapshotErrors(
description=txt, snapshot_uuid=uuid, severity=Severity.Error description=txt,
snapshot_uuid=uuid,
severity=Severity.Error,
wbid=wbid,
) )
error.save(commit=True) error.save(commit=True)
self.result[filename] = 'Error' self.result[filename] = 'Error'

View File

@ -273,7 +273,6 @@ class UploadSnapshotView(GenericMixView):
'version': __version__, 'version': __version__,
} }
if form.validate_on_submit(): if form.validate_on_submit():
# import pdb; pdb.set_trace()
snapshot, devices = form.save(commit=False) snapshot, devices = form.save(commit=False)
if lot_id: if lot_id:
lot = lots.filter(Lot.id == lot_id).one() lot = lots.filter(Lot.id == lot_id).one()