@@ -1127,7 +1127,7 @@ def clean(self):
1127
1127
if (self .type in (
1128
1128
CustomFieldTypeChoices .TYPE_OBJECT ,
1129
1129
CustomFieldTypeChoices .TYPE_MULTIOBJECT ,
1130
- ) and self .related_object_type_id and
1130
+ ) and self .related_object_type_id and
1131
1131
self .related_object_type .app_label == APP_LABEL ):
1132
1132
self ._check_recursion ()
1133
1133
@@ -1161,11 +1161,11 @@ def _check_recursion(self):
1161
1161
def _has_circular_reference (self , custom_object_type , visited ):
1162
1162
"""
1163
1163
Recursively check if there's a circular reference by following the dependency chain.
1164
-
1164
+
1165
1165
Args:
1166
1166
custom_object_type: The CustomObjectType object to check
1167
1167
visited: Set of custom object type IDs already visited in this traversal
1168
-
1168
+
1169
1169
Returns:
1170
1170
bool: True if a circular reference is detected, False otherwise
1171
1171
"""
@@ -1175,7 +1175,7 @@ def _has_circular_reference(self, custom_object_type, visited):
1175
1175
1176
1176
# Add this type to visited set
1177
1177
visited .add (custom_object_type .id )
1178
-
1178
+
1179
1179
# Check all object and multiobject fields in this custom object type
1180
1180
for field in custom_object_type .fields .filter (
1181
1181
type__in = [
@@ -1191,7 +1191,7 @@ def _has_circular_reference(self, custom_object_type, visited):
1191
1191
next_custom_object_type = CustomObjectType .objects .get (object_type = field .related_object_type )
1192
1192
except CustomObjectType .DoesNotExist :
1193
1193
continue
1194
-
1194
+
1195
1195
# Recursively check this dependency
1196
1196
if self ._has_circular_reference (next_custom_object_type , visited ):
1197
1197
return True
0 commit comments