page_params: Remove unused prompt_for_invites.

It’s unused since commit ebe959f2b0.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-02-06 21:19:03 -08:00 committed by Tim Abbott
parent 0115fa9c60
commit b59faf540f
3 changed files with 1 additions and 13 deletions

View File

@ -139,7 +139,6 @@ def build_page_params_for_home_page_load(
narrow_stream: Optional[Stream],
narrow_topic_name: Optional[str],
first_in_realm: bool,
prompt_for_invites: bool,
needs_tutorial: bool,
) -> Tuple[int, Dict[str, object]]:
"""
@ -209,7 +208,6 @@ def build_page_params_for_home_page_load(
language_list=get_language_list(),
needs_tutorial=needs_tutorial,
first_in_realm=first_in_realm,
prompt_for_invites=prompt_for_invites,
furthest_read_time=furthest_read_time,
bot_types=get_bot_types(user_profile),
two_fa_enabled=two_fa_enabled,

View File

@ -98,7 +98,6 @@ class HomeTest(ZulipTestCase):
"password_min_length",
"presences",
"promote_sponsoring_zulip",
"prompt_for_invites",
"queue_id",
"realm_add_custom_emoji_policy",
"realm_allow_edit_history",
@ -351,7 +350,6 @@ class HomeTest(ZulipTestCase):
"needs_tutorial",
"no_event_queue",
"promote_sponsoring_zulip",
"prompt_for_invites",
"queue_id",
"realm_rendered_description",
"request_language",

View File

@ -19,7 +19,7 @@ from zerver.lib.request import RequestNotes
from zerver.lib.streams import access_stream_by_name
from zerver.lib.subdomains import get_subdomain
from zerver.lib.user_counts import realm_user_count
from zerver.models import PreregistrationUser, Realm, RealmUserDefault, Stream, UserProfile
from zerver.models import Realm, RealmUserDefault, Stream, UserProfile
def need_accept_tos(user_profile: Optional[UserProfile]) -> bool:
@ -216,17 +216,10 @@ def home_real(request: HttpRequest) -> HttpResponse:
if user_profile is not None:
first_in_realm = realm_user_count(user_profile.realm) == 1
# If you are the only person in the realm and you didn't invite
# anyone, we'll continue to encourage you to do so on the frontend.
prompt_for_invites = (
first_in_realm
and not PreregistrationUser.objects.filter(referred_by=user_profile).count()
)
needs_tutorial = user_profile.tutorial_status == UserProfile.TUTORIAL_WAITING
else:
first_in_realm = False
prompt_for_invites = False
# The current tutorial doesn't super make sense for logged-out users.
needs_tutorial = False
@ -239,7 +232,6 @@ def home_real(request: HttpRequest) -> HttpResponse:
narrow_stream=narrow_stream,
narrow_topic_name=narrow_topic_name,
first_in_realm=first_in_realm,
prompt_for_invites=prompt_for_invites,
needs_tutorial=needs_tutorial,
)