Skip to content

Commit 706e14e

Browse files
committed
Reduce N+1
1 parent 19f8991 commit 706e14e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entity/api_v2/serializers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ def get_attrs(self, obj: Entity) -> list[EntityDetailAttributeSerializer.EntityD
550550
],
551551
"note": x.note,
552552
}
553-
for x in obj.attrs.filter(is_active=True).order_by("index")
553+
for x in obj.attrs.filter(is_active=True).prefetch_related("referral").order_by("index")
554554
]
555555

556556
# add and remove attributes depending on entity

0 commit comments

Comments
 (0)