Fix a super annoying validation issue
- Was throwing opaque "too many values to unpack" error - Simply needed the name of the field.
This commit is contained in:
parent
1fb76b9987
commit
8662e6a109
|
|
@ -49,7 +49,9 @@ class InvenTreeMoneySerializer(MoneyField):
|
|||
if amount is not None:
|
||||
amount = Decimal(amount)
|
||||
except:
|
||||
raise ValidationError(_("Must be a valid number"))
|
||||
raise ValidationError({
|
||||
self.field_name: _("Must be a valid number")
|
||||
})
|
||||
|
||||
currency = data.get(get_currency_field_name(self.field_name), self.default_currency)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue