2019-02-02 23:53:20 +01:00
|
|
|
from django.db import migrations
|
2020-04-27 07:19:08 +02:00
|
|
|
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
|
2017-09-26 00:03:27 +02:00
|
|
|
from django.db.migrations.state import StateApps
|
|
|
|
|
2020-01-14 21:59:46 +01:00
|
|
|
|
2017-10-26 11:36:30 +02:00
|
|
|
def set_tutorial_status_to_finished(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
|
2017-09-26 00:03:27 +02:00
|
|
|
UserProfile = apps.get_model('zerver', 'UserProfile')
|
2017-11-02 09:17:27 +01:00
|
|
|
UserProfile.objects.update(tutorial_status='F')
|
2017-09-26 00:03:27 +02:00
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
('zerver', '0108_fix_default_string_id'),
|
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
2020-04-29 08:43:25 +02:00
|
|
|
migrations.RunPython(set_tutorial_status_to_finished, elidable=True)
|
2017-09-26 00:03:27 +02:00
|
|
|
]
|