Improved error message (#10433)
This commit is contained in:
parent
867cd24088
commit
7e4d1684ed
|
|
@ -285,6 +285,10 @@ class StockItemTestResultSerializer(
|
|||
part__tree_id=stock_item.part.tree_id, part__in=ancestors, key=test_key
|
||||
).first():
|
||||
data['template'] = template
|
||||
else:
|
||||
raise ValidationError({
|
||||
'test': _('No matching test found for this part')
|
||||
})
|
||||
|
||||
if not template:
|
||||
raise ValidationError(_('Template ID or test name must be provided'))
|
||||
|
|
|
|||
Loading…
Reference in New Issue