Earthman deck: delete stray Pentacles courts; fix tarot_fan suit order

- Migration 0041: delete Maid/Jack/Queen/King of Pentacles (suit=PENTACLES,
  arcana=MINOR, numbers 11-14) from Earthman deck — duplicates of the correct
  CROWNS courts that already exist; escaped migration 0024's rename sweep
- tarot_fan view: _suit_order now uses Earthman suit names (BRANDS/GRAILS/BLADES/CROWNS)
  in correct display order; old Fiorentine names kept as fallback

Code architected by Disco DeDisco <discodedisco@outlook.com>
Git commit message Co-Authored-By:
Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Disco DeDisco
2026-04-27 20:48:12 -04:00
parent a724479e60
commit e2c9dc4e8a
2 changed files with 33 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
"""
Data migration: delete 4 stray Earthman court cards that were never cleaned up.
Maid/Jack/Queen/King of Pentacles (suit=PENTACLES, arcana=MINOR, numbers 11-14)
are duplicates of the correct Maid/Jack/Queen/King of Crowns (suit=CROWNS,
arcana=MIDDLE) that already exist. The PENTACLES rows appeared before migration
0024 could catch them and were never removed.
"""
from django.db import migrations
def delete_stray_pentacles(apps, schema_editor):
TarotCard = apps.get_model("epic", "TarotCard")
DeckVariant = apps.get_model("epic", "DeckVariant")
earthman = DeckVariant.objects.filter(slug="earthman").first()
if not earthman:
return
TarotCard.objects.filter(
deck_variant=earthman, suit="PENTACLES", number__in=[11, 12, 13, 14],
).delete()
class Migration(migrations.Migration):
dependencies = [
("epic", "0040_rename_jovent_to_intent"),
]
operations = [
migrations.RunPython(delete_stray_pentacles, migrations.RunPython.noop),
]