fix Nomad icon fa-hat-cowboy → fa-hat-cowboy-side; setup_sea_session command
- migration 0011 ICONS dict corrected for fresh installs - migration 0013 data fix for existing DBs (filters on old value to be safe) - TarotCardSuitIconTest updated to assert fa-hat-cowboy-side - setup_sea_session: single-gamer PICK SEA dev session w. pre-auth URL 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:
@@ -4,7 +4,7 @@ All other Major Arcana already have fa-hand-dots from migration 0010.
|
||||
"""
|
||||
from django.db import migrations
|
||||
|
||||
ICONS = {0: 'fa-hat-cowboy', 1: 'fa-hat-wizard'}
|
||||
ICONS = {0: 'fa-hat-cowboy-side', 1: 'fa-hat-wizard'}
|
||||
|
||||
|
||||
def assign_icons(apps, schema_editor):
|
||||
|
||||
25
src/apps/epic/migrations/0013_fix_nomad_icon.py
Normal file
25
src/apps/epic/migrations/0013_fix_nomad_icon.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""Fix The Nomad icon: fa-hat-cowboy → fa-hat-cowboy-side."""
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def fix_nomad_icon(apps, schema_editor):
|
||||
TarotCard = apps.get_model("epic", "TarotCard")
|
||||
DeckVariant = apps.get_model("epic", "DeckVariant")
|
||||
try:
|
||||
earthman = DeckVariant.objects.get(slug="earthman")
|
||||
except DeckVariant.DoesNotExist:
|
||||
return
|
||||
TarotCard.objects.filter(
|
||||
deck_variant=earthman, arcana="MAJOR", number=0, icon="fa-hat-cowboy"
|
||||
).update(icon="fa-hat-cowboy-side")
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("epic", "0012_delete_stray_pentacles"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(fix_nomad_icon, reverse_code=migrations.RunPython.noop),
|
||||
]
|
||||
@@ -51,7 +51,7 @@ class TarotCardSuitIconTest(SimpleTestCase):
|
||||
"""TarotCard.suit_icon — icon class resolution."""
|
||||
|
||||
def test_major_with_icon_returns_icon(self):
|
||||
self.assertEqual(_card('MAJOR', 0, icon='fa-hat-cowboy').suit_icon, 'fa-hat-cowboy')
|
||||
self.assertEqual(_card('MAJOR', 0, icon='fa-hat-cowboy-side').suit_icon, 'fa-hat-cowboy-side')
|
||||
|
||||
def test_major_without_icon_returns_empty(self):
|
||||
self.assertEqual(_card('MAJOR', 5).suit_icon, '')
|
||||
|
||||
Reference in New Issue
Block a user