mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 08:15:27 +01:00
Fix: prune invalid custom fields (#9224)
This commit is contained in:
parent
d364436817
commit
61cb5103ed
2 changed files with 6 additions and 5 deletions
|
|
@ -1136,9 +1136,8 @@ class SavedViewSerializer(OwnedObjectSerializer):
|
|||
): # i.e. check for 'custom_field_' prefix
|
||||
field_id = int(re.search(r"\d+", field)[0])
|
||||
if not CustomField.objects.filter(id=field_id).exists():
|
||||
raise serializers.ValidationError(
|
||||
f"Invalid field: {field}",
|
||||
)
|
||||
# In case the field was deleted, just remove from the list
|
||||
attrs["display_fields"].remove(field)
|
||||
elif field not in SavedView.DisplayFields.values:
|
||||
raise serializers.ValidationError(
|
||||
f"Invalid field: {field}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue