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
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,