AAP-90692 Nested POST /api/v2/inventories/{id}/hosts/ times out (#16657)

* Update query to use .contains
This commit is contained in:
Liam Allen
2026-09-22 10:27:30 +01:00
committed by GitHub
parent b3e34bee97
commit 92ff58a1f3
3 changed files with 30 additions and 3 deletions
+1 -1
View File
@@ -728,7 +728,7 @@ class SubListCreateAttachDetachAPIView(SubListCreateAPIView):
return Response(attach_errors, status=status.HTTP_400_BAD_REQUEST)
# Attach the object to the collection.
if sub not in relationship.all():
if not relationship.contains(sub):
relationship.add(sub)
if created: