mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-30 04:26:44 +00:00
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:
|
if amount is not None:
|
||||||
amount = Decimal(amount)
|
amount = Decimal(amount)
|
||||||
except:
|
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)
|
currency = data.get(get_currency_field_name(self.field_name), self.default_currency)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user