mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-21 04:52:40 +00:00
Fix: reject over-long text zone values instead of truncating
A truncated URL is a different URL. Let field validation reject string and URL values that are too long.
This commit is contained in:
1 parent
7b25551e1e
commit
fcc465ec2e
2 files changed
+64
-21
No files matched your search
@@ -991,10 +991,10 @@ def _convert_value(
|
||||
if data_type in (
|
||||
CustomField.FieldDataType.STRING,
|
||||
CustomField.FieldDataType.URL,
|
||||
CustomField.FieldDataType.LONG_TEXT,
|
||||
):
|
||||
return value[:128]
|
||||
|
||||
elif data_type == CustomField.FieldDataType.LONG_TEXT:
|
||||
# Returned whole; _prepare_field_update validates length and URL
|
||||
# format, so a value is rejected rather than truncated.
|
||||
return value
|
||||
|
||||
elif data_type == CustomField.FieldDataType.INT:
|
||||
|
||||
Reference in new issue
Block a user