mirror of
https://github.com/barkeser2002/offline-db.git
synced 2026-09-25 05:20:06 +03:00
- 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>
25 lines
639 B
Python
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),
|
|
]
|