2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-10-03 15:52:51 +00:00

Improved error message (#10433)

This commit is contained in:
Oliver
2025-09-30 11:21:02 +10:00
committed by GitHub
parent 867cd24088
commit 7e4d1684ed

View File

@@ -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'))