mirror of
https://github.com/barkeser2002/offline-db.git
synced 2026-09-25 02:19:59 +03:00
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
29 lines
833 B
Python
29 lines
833 B
Python
# Generated by Django 5.1.6
|
|
|
|
from django.db import migrations
|
|
|
|
def create_marathoner_badge(apps, schema_editor):
|
|
Badge = apps.get_model('users', 'Badge')
|
|
badge_data = {
|
|
'slug': 'marathoner',
|
|
'name': 'Marathoner',
|
|
'description': 'Watched 50 episodes in total',
|
|
'icon_url': '/static/badges/marathoner.png'
|
|
}
|
|
if not Badge.objects.filter(slug=badge_data['slug']).exists():
|
|
Badge.objects.create(**badge_data)
|
|
|
|
def remove_marathoner_badge(apps, schema_editor):
|
|
Badge = apps.get_model('users', 'Badge')
|
|
Badge.objects.filter(slug='marathoner').delete()
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('users', '0010_seed_season_completist'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(create_marathoner_badge, remove_marathoner_badge),
|
|
]
|