Fix card_multiselect and trade create view using old db fields

This commit is contained in:
badblocks 2025-03-17 15:38:20 -07:00
parent c77e32a82d
commit fb9f2f5848
4 changed files with 13 additions and 14 deletions

View file

@ -120,8 +120,8 @@ class TradeOfferCreateForm(ModelForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Populate choices from Card model
cards = Card.objects.order_by("name", "rarity__pk")
# Populate choices from Card model using the new field 'rarity_level' instead of the removed relation.
cards = Card.objects.order_by("name", "rarity_level")
choices = [(str(card.pk), card.name) for card in cards]
self.fields["have_cards"].choices = choices
self.fields["want_cards"].choices = choices