progress on conversion to tailwind
This commit is contained in:
parent
6a872124c6
commit
6e2843c60e
110 changed files with 4997 additions and 1691 deletions
|
|
@ -6,11 +6,8 @@ from cards.models import Card
|
|||
|
||||
def check_trade_offer_rarity(instance):
|
||||
combined_cards = list(instance.have_cards.all()) + list(instance.want_cards.all())
|
||||
# Map rarities 6 (Super Rare) and 7 (Special Art Rare) to a single value (here, 6)
|
||||
rarities = {
|
||||
card.rarity_id if card.rarity_id not in (6, 7) else 6
|
||||
for card in combined_cards
|
||||
}
|
||||
# Use the normalized rarity from each card
|
||||
rarities = {card.normalized_rarity for card in combined_cards}
|
||||
if len(rarities) > 1:
|
||||
raise ValidationError("All cards in a trade offer must have the same rarity.")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue