mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-08-17 16:23:18 +00:00
one-liner
This commit is contained in:
@@ -24,9 +24,11 @@ def _truncate_to_field_limit(value: Any, field: FieldInfo) -> Any:
|
||||
(m.max_length for m in field.metadata if hasattr(m, "max_length")),
|
||||
None,
|
||||
)
|
||||
if limit is None or not isinstance(value, (list, str)):
|
||||
return value
|
||||
return value[:limit]
|
||||
return (
|
||||
value
|
||||
if (limit is None or not isinstance(value, (list, str)))
|
||||
else value[:limit]
|
||||
)
|
||||
|
||||
|
||||
class TaxonomyChoice(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user