Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
user_profile: Remove 'onboarding_steps' field.
Prakhar Pratyush1ce7c11705b6
diff --git a/zerver/lib/create_user.py b/zerver/lib/create_user.pyindex e92c50a2162..dccece254d6 100644--- a/zerver/lib/create_user.py+++ b/zerver/lib/create_user.py@@ -2,7 +2,6 @@ from datetime import datetimefrom email.headerregistry import Addressfrom typing import Optional, Union-import orjsonfrom django.contrib.auth.models import UserManagerfrom django.utils.timezone import now as timezone_now@@ -125,7 +124,6 @@ def create_user_profile(tos_version=tos_version,timezone=timezone,tutorial_status=tutorial_status,- onboarding_steps=orjson.dumps([]).decode(),default_language=default_language,delivery_email=email,email_address_visibility=email_address_visibility,diff --git a/zerver/lib/onboarding_steps.py b/zerver/lib/onboarding_steps.pyindex df749a209b5..8c3300d0745 100644--- a/zerver/lib/onboarding_steps.py+++ b/zerver/lib/onboarding_steps.py@@ -69,8 +69,7 @@ def copy_onboarding_steps(source_profile: UserProfile, target_profile: UserProfitimestamp=onboarding_step.timestamp,)- # TODO: The 'tutorial_status' and 'onboarding_steps' fields- # of 'UserProfile' model are no longer used. Remove them.+ # TODO: The 'tutorial_status' field of 'UserProfile' model+ # is no longer used. Remove it.target_profile.tutorial_status = source_profile.tutorial_status- target_profile.onboarding_steps = source_profile.onboarding_steps- target_profile.save(update_fields=["tutorial_status", "onboarding_steps"])+ target_profile.save(update_fields=["tutorial_status"])diff --git a/zerver/migrations/0524_remove_userprofile_onboarding_steps.py b/zerver/migrations/0524_remove_userprofile_onboarding_steps.pynew file mode 100644index 00000000000..a8ef4340402--- /dev/null+++ b/zerver/migrations/0524_remove_userprofile_onboarding_steps.py@@ -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",+ ),+ ]diff --git a/zerver/models/users.py b/zerver/models/users.pyindex e68d52d973d..e27ff36571d 100644--- a/zerver/models/users.py+++ b/zerver/models/users.py@@ -576,12 +576,6 @@ class UserProfile(AbstractBaseUser, PermissionsMixin, UserBaseSettings):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)objects = UserManager()