Skip to content

Commit bf0912b

Browse files
rename
1 parent 2994efd commit bf0912b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

dojo/tags/inheritance.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ def apply_inherited_tags_for_locations(locations, *, product):
380380
):
381381
product_ids_by_location[loc_id].add(prod_id)
382382

383+
# prefetch all tags for all linked products up front so we can pass a callable to the sync function
383384
all_product_ids = {pid for pids in product_ids_by_location.values() for pid in pids}
384385
product_qs = Product.objects.filter(id__in=all_product_ids).prefetch_related("tags")
385386
if not system_wide:
@@ -388,7 +389,7 @@ def apply_inherited_tags_for_locations(locations, *, product):
388389
p.id: {t.name for t in p.tags.all()} for p in product_qs
389390
}
390391

391-
def _target_for_location_pk(pk):
392+
def _target_tag_names_for_location_pk(pk):
392393
names: set[str] = set()
393394
for pid in product_ids_by_location[pk]:
394395
# product_ids_by_location may contain products that shouldn't contribute
@@ -401,7 +402,7 @@ def _target_for_location_pk(pk):
401402
_sync_inheritance_for_ids(
402403
Location,
403404
[loc.id for loc in locations],
404-
target_tag_names=_target_for_location_pk,
405+
target_tag_names=_target_tag_names_for_location_pk,
405406
)
406407

407408

0 commit comments

Comments
 (0)