User Tours are walkthroughs we are able to give in our frontends. This sets up the backend support for them by creating the model, setting up the initial backfill, adds in a signal handler to init the UserTour model on User creation, and sets up some endpoints to get user tour information and update it. It is also being initialized with a waffle flag to control the rollout. The flag is intended to control all tours and not allow for opting into only some tours.
27 lines
1.0 KiB
Python
27 lines
1.0 KiB
Python
# Generated by Django 3.2.8 on 2021-11-19 15:58
|
|
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='UserTour',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('course_home_tour_status', models.CharField(choices=[('show-existing-user-tour', 'Show existing user tour'), ('show-new-user-tour', 'Show new user tour'), ('no-tour', 'Do not show user tour')], default='show-new-user-tour', max_length=50)),
|
|
('show_courseware_tour', models.BooleanField(default=True)),
|
|
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='tour', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
),
|
|
]
|