Fix: prevent self-linking when bulk edit doc link (#9629)

This commit is contained in:
shamoon 2025-04-14 07:12:50 -07:00 committed by GitHub
parent f269919410
commit 6dea158de9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 0 deletions

View file

@ -179,6 +179,12 @@ def modify_custom_fields(
custom_field.data_type
]
defaults[value_field] = value
if (
custom_field.data_type == CustomField.FieldDataType.DOCUMENTLINK
and doc_id in value
):
# Prevent self-linking
continue
CustomFieldInstance.objects.update_or_create(
document_id=doc_id,
field_id=field_id,