new migrations in apps.lyric ensure new users start only w. Earthman card deck unlocked; FTs.test_component_cards_tarot.py updated to assert that user specifically has Fiorentine deck unlocked as well
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
24
src/apps/lyric/migrations/0016_backfill_unlocked_decks.py
Normal file
24
src/apps/lyric/migrations/0016_backfill_unlocked_decks.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
def backfill_unlocked_decks(apps, schema_editor):
|
||||
User = apps.get_model("lyric", "User")
|
||||
DeckVariant = apps.get_model("epic", "DeckVariant")
|
||||
try:
|
||||
earthman = DeckVariant.objects.get(slug="earthman")
|
||||
except DeckVariant.DoesNotExist:
|
||||
return
|
||||
for user in User.objects.filter(unlocked_decks__isnull=True):
|
||||
user.unlocked_decks.add(earthman)
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("lyric", "0015_user_unlocked_decks"),
|
||||
("epic", "0010_seed_deck_variants_and_earthman"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RunPython(backfill_unlocked_decks, migrations.RunPython.noop),
|
||||
]
|
||||
Reference in New Issue
Block a user