Files
offline-db/users/migrations/0031_seed_century_club_badge.py
google-labs-jules[bot] e769de66ed feat(users): add Century Club badge (#134)
Current Focus Mode: C (The Architect)
Changes Made:
- Created data migration `users/migrations/0031_seed_century_club_badge.py` to seed the "Century Club" badge.
- Added logic in `users/services.py` to award the badge when a user watches 100 unique episodes.
- Added unit tests in `users/tests/test_century_club_badge.py` to verify the logic.

Impact on System:
- Users will now receive a "Century Club" badge and notification upon watching their 100th unique episode.
- This gamification feature encourages user engagement and binge-watching.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
2026-01-23 05:24:14 +00:00

25 lines
633 B
Python

# Generated by Django 5.1.6 on 2026-01-23 00:00
from django.db import migrations
def seed_century_club_badge(apps, schema_editor):
Badge = apps.get_model('users', 'Badge')
Badge.objects.get_or_create(
slug='century-club',
defaults={
'name': 'Century Club',
'description': "Watched 100 episodes. That's dedication!",
'icon_url': '/static/badges/century_club.png'
}
)
class Migration(migrations.Migration):
dependencies = [
('users', '0030_seed_otaku_badge'),
]
operations = [
migrations.RunPython(seed_century_club_badge),
]