mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-07-28 18:24:38 -05:00
Fix: Allow negative monetary values with a current code (#6358)
* Updates the currency validation to allow an optional negative * Update frontend regex --------- Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
This commit is contained in:
@@ -546,7 +546,7 @@ class CustomFieldInstanceSerializer(serializers.ModelSerializer):
|
||||
except Exception:
|
||||
# If that fails, try to validate as a monetary string
|
||||
RegexValidator(
|
||||
regex=r"^[A-Z][A-Z][A-Z]\d+(\.\d{2,2})$",
|
||||
regex=r"^[A-Z]{3}-?\d+(\.\d{2,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:
|
||||
|
Reference in New Issue
Block a user