mirror of
https://github.com/barkeser2002/offline-db.git
synced 2026-09-25 06:00:11 +03:00
Current Focus Mode: C Changes Made: - Added 'Pilot Connoisseur' badge logic in `users/services.py` (awarded for watching 5 pilot episodes). - Created migration `users/migrations/0025_seed_pilot_connoisseur_badge.py` to seed the badge. - Added unit tests in `users/tests/test_pilot_connoisseur_badge.py`. Impact on System: - Users will now receive a new badge when they watch the first episode of 5 different anime series. - Enhances gamification and user engagement. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
23 lines
630 B
Python
23 lines
630 B
Python
from django.db import migrations
|
|
|
|
def seed_pilot_connoisseur_badge(apps, schema_editor):
|
|
Badge = apps.get_model('users', 'Badge')
|
|
Badge.objects.get_or_create(
|
|
slug='pilot-connoisseur',
|
|
defaults={
|
|
'name': 'Pilot Connoisseur',
|
|
'description': 'Watched the first episode of 5 different anime series.',
|
|
'icon_url': '/static/badges/pilot_connoisseur.png'
|
|
}
|
|
)
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("users", "0024_seed_genre_savant_badge"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunPython(seed_pilot_connoisseur_badge),
|
|
]
|