Files
offline-db/users/migrations/0008_seed_social_butterfly.py
google-labs-jules[bot] 5ee0202992 feat(users): add social butterfly badge (#78)
- Added 'Social Butterfly' badge awarded for chatting in 5 distinct rooms.
- Created data migration `0008_seed_social_butterfly.py` to seed the badge.
- Updated `users/services.py` with badge check logic.
- Added test case in `users/tests/test_badges.py`.
- Fixed missing `static/` directory warning.
- Updated requirements to include `python-dotenv` explicitly.

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

25 lines
639 B
Python

# Generated by Django 5.1.6 on 2024-02-22 10:00
from django.db import migrations
def seed_social_butterfly(apps, schema_editor):
Badge = apps.get_model('users', 'Badge')
Badge.objects.get_or_create(
slug='social-butterfly',
defaults={
'name': 'Social Butterfly',
'description': 'Participated in 5 different chat rooms.',
'icon_url': '/static/badges/social-butterfly.png'
}
)
class Migration(migrations.Migration):
dependencies = [
('users', '0007_seed_early_bird'),
]
operations = [
migrations.RunPython(seed_social_butterfly),
]