user_profile: Remove 'onboarding_steps' field.

Removes the 'onboarding_steps' field on 'UserProfile'
model which is no longer used.

It was introduced back in 2013 (b5e22bf), and is no
longer used.

Fixes part of #30043.
This commit is contained in:
Prakhar Pratyush 2024-05-29 18:08:50 +05:30 committed by Tim Abbott
parent eada57921e
commit 1ce7c11705
4 changed files with 19 additions and 12 deletions

View File

@ -2,7 +2,6 @@ from datetime import datetime
from email.headerregistry import Address from email.headerregistry import Address
from typing import Optional, Union from typing import Optional, Union
import orjson
from django.contrib.auth.models import UserManager from django.contrib.auth.models import UserManager
from django.utils.timezone import now as timezone_now from django.utils.timezone import now as timezone_now
@ -125,7 +124,6 @@ def create_user_profile(
tos_version=tos_version, tos_version=tos_version,
timezone=timezone, timezone=timezone,
tutorial_status=tutorial_status, tutorial_status=tutorial_status,
onboarding_steps=orjson.dumps([]).decode(),
default_language=default_language, default_language=default_language,
delivery_email=email, delivery_email=email,
email_address_visibility=email_address_visibility, email_address_visibility=email_address_visibility,

View File

@ -69,8 +69,7 @@ def copy_onboarding_steps(source_profile: UserProfile, target_profile: UserProfi
timestamp=onboarding_step.timestamp, timestamp=onboarding_step.timestamp,
) )
# TODO: The 'tutorial_status' and 'onboarding_steps' fields # TODO: The 'tutorial_status' field of 'UserProfile' model
# of 'UserProfile' model are no longer used. Remove them. # is no longer used. Remove it.
target_profile.tutorial_status = source_profile.tutorial_status target_profile.tutorial_status = source_profile.tutorial_status
target_profile.onboarding_steps = source_profile.onboarding_steps target_profile.save(update_fields=["tutorial_status"])
target_profile.save(update_fields=["tutorial_status", "onboarding_steps"])

View File

@ -0,0 +1,16 @@
# Generated by Django 5.0.6 on 2024-05-29 12:19
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("zerver", "0523_alter_multiuseinvite_subscribe_to_default_streams_and_more"),
]
operations = [
migrations.RemoveField(
model_name="userprofile",
name="onboarding_steps",
),
]

View File

@ -576,12 +576,6 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings):
default=TUTORIAL_WAITING, choices=TUTORIAL_STATES, max_length=1 default=TUTORIAL_WAITING, choices=TUTORIAL_STATES, max_length=1
) )
# Contains serialized JSON of the form:
# [("step 1", true), ("step 2", false)]
# where the second element of each tuple is if the step has been
# completed.
onboarding_steps = models.TextField(default="[]")
zoom_token = models.JSONField(default=None, null=True) zoom_token = models.JSONField(default=None, null=True)
objects = UserManager() objects = UserManager()