28 lines
817 B
Python
28 lines
817 B
Python
# Generated by Django 6.1.1 on 2026-10-19 14:54
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
def mark_existing_demo(apps, schema_editor):
|
|
User = apps.get_model('auth', 'User')
|
|
UserSettings = apps.get_model('planner', 'UserSettings')
|
|
user = User.objects.filter(username='demo', is_staff=False, is_superuser=False).first()
|
|
if user:
|
|
UserSettings.objects.filter(user_id=user.pk).update(is_demo=True)
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('planner', '0021_automatic_hydration'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddField(
|
|
model_name='usersettings',
|
|
name='is_demo',
|
|
field=models.BooleanField(default=False, editable=False),
|
|
),
|
|
migrations.RunPython(mark_existing_demo, migrations.RunPython.noop),
|
|
]
|