mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 08:15:27 +01:00
Fix: make backend monetary validation accept unpadded decimals (#6626)
This commit is contained in:
parent
caec0ed4d1
commit
6ea25a96a3
3 changed files with 10 additions and 18 deletions
|
|
@ -547,7 +547,7 @@ class CustomFieldInstanceSerializer(serializers.ModelSerializer):
|
|||
except Exception:
|
||||
# If that fails, try to validate as a monetary string
|
||||
RegexValidator(
|
||||
regex=r"^[A-Z]{3}-?\d+(\.\d{2,2})$",
|
||||
regex=r"^[A-Z]{3}-?\d+(\.\d{1,2})$",
|
||||
message="Must be a two-decimal number with optional currency code e.g. GBP123.45",
|
||||
)(data["value"])
|
||||
elif field.data_type == CustomField.FieldDataType.STRING:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue