Skip to content

Commit 7b2cea7

Browse files
authored
fix: pack weapons not showing on fighter cards (#1541)
## Summary - Fix pack weapon profiles being excluded from fighter card display by using `all_content()` in the `weapon_profiles_field` prefetch - Fix form validation rejecting pack weapon profiles and upgrades when adding equipment, by setting `with_packs()` querysets on `weapon_profiles_field` and `upgrades_field` ## Test plan - [x] Add a pack weapon with a named profile to a fighter via trading post — assignment should be created - [x] Verify the weapon and its profiles appear on the fighter card - [x] Verify core (non-pack) weapons still work as before Fixes #1540 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent c8359eb commit 7b2cea7

File tree

3 files changed

+44
-35
lines changed

3 files changed

+44
-35
lines changed

gyrinx/core/models/list.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,10 @@ def with_related_data(self):
14781478
"listfighterequipmentassignment_set__content_equipment__contentweaponprofile_set",
14791479
queryset=ContentWeaponProfile.objects.all_content(),
14801480
),
1481-
"listfighterequipmentassignment_set__weapon_profiles_field",
1481+
Prefetch(
1482+
"listfighterequipmentassignment_set__weapon_profiles_field",
1483+
queryset=ContentWeaponProfile.objects.all_content(),
1484+
),
14821485
"listfighterequipmentassignment_set__weapon_accessories_field__modifiers",
14831486
"listfighterequipmentassignment_set__content_equipment__modifiers",
14841487
"listfighterequipmentassignment_set__upgrades_field__modifiers",

0 commit comments

Comments
 (0)