Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
onboarding_steps: Rename 'copy_hotspots' function.
Prakhar Pratyushe8769f80a60f
diff --git a/zerver/lib/create_user.py b/zerver/lib/create_user.pyindex cc4776dbd19..70f1b6b7252 100644--- a/zerver/lib/create_user.py+++ b/zerver/lib/create_user.py@@ -6,7 +6,7 @@ import orjsonfrom django.contrib.auth.models import UserManagerfrom django.utils.timezone import now as timezone_now-from zerver.lib.hotspots import copy_hotspots+from zerver.lib.hotspots import copy_onboarding_stepsfrom zerver.lib.i18n import get_default_language_for_new_userfrom zerver.lib.timezone import canonicalize_timezonefrom zerver.lib.upload import copy_avatar@@ -64,7 +64,7 @@ def copy_default_settings()copy_avatar(settings_source, target_profile)- copy_hotspots(settings_source, target_profile)+ copy_onboarding_steps(settings_source, target_profile)def get_display_email_address(user_profile: UserProfile) -> str:diff --git a/zerver/lib/hotspots.py b/zerver/lib/hotspots.pyindex 24a98be4c73..4fcbe8a4cfe 100644--- a/zerver/lib/hotspots.py+++ b/zerver/lib/hotspots.py@@ -141,14 +141,16 @@ def get_next_onboarding_steps(user: UserProfile) -> List[Dict[str, Any]]:return onboarding_steps-def copy_hotspots(source_profile: UserProfile, target_profile: UserProfile) -> None:- for userhotspot in frozenset(OnboardingStep.objects.filter(user=source_profile)):+def copy_onboarding_steps(source_profile: UserProfile, target_profile: UserProfile) -> None:+ for onboarding_step in frozenset(OnboardingStep.objects.filter(user=source_profile)):OnboardingStep.objects.create(user=target_profile,- onboarding_step=userhotspot.onboarding_step,- timestamp=userhotspot.timestamp,+ onboarding_step=onboarding_step.onboarding_step,+ timestamp=onboarding_step.timestamp,)+ # TODO: The 'tutorial_status' and 'onboarding_steps' fields+ # of 'UserProfile' model are no longer used. Remove them.target_profile.tutorial_status = source_profile.tutorial_statustarget_profile.onboarding_steps = source_profile.onboarding_stepstarget_profile.save(update_fields=["tutorial_status", "onboarding_steps"])