web_public_guest: Rename to web_public_visitor for clarity.

Using web_public_guest for anonymous users is confusing since
'guest' is actually a logged-in user compared to
web_public_guest which is not logged-in and has only
read access to messages. So, we rename it to
web_public_visitor.
This commit is contained in:
Aman Agrawal 2020-10-04 12:17:36 +05:30 committed by Tim Abbott
parent 7c2c82b190
commit fbf7cb82a7
7 changed files with 10 additions and 10 deletions

View File

@ -762,9 +762,9 @@ run_test("electron_bridge", () => {
assert.equal(activity.compute_active_status(), activity.ACTIVE);
});
run_test("test_send_or_receive_no_presence_for_web_public_guest", () => {
run_test("test_send_or_receive_no_presence_for_web_public_visitor", () => {
set_global("page_params", {
is_web_public_guest: true,
is_web_public_visitor: true,
});
activity.send_presence_to_server();
});

View File

@ -176,7 +176,7 @@ exports.send_presence_to_server = function (want_redraw) {
// which will clear suspect_offline and potentially trigger a
// reload if the device was offline for more than
// DEFAULT_EVENT_QUEUE_TIMEOUT_SECS).
if (page_params.is_web_public_guest) {
if (page_params.is_web_public_visitor) {
return;
}

View File

@ -168,9 +168,9 @@ function get_events(options) {
}
// TODO: In the future, we may implement Tornado support for live
// update for web-public guests, but until then, there's nothing
// update for web_public_visitor, but until then, there's nothing
// to do here.
if (page_params.is_web_public_guest) {
if (page_params.is_web_public_visitor) {
return;
}

View File

@ -779,7 +779,7 @@ def zulip_otp_required(
"""
:if_configured: If ``True``, an authenticated user with no confirmed
OTP devices will be allowed. Also, non-authenticated users will be
allowed as web_public_guest users. Default is ``False``. If ``False``,
allowed as web_public_visitor users. Default is ``False``. If ``False``,
2FA will not do any authentication.
"""
if_configured = settings.TWO_FACTOR_AUTHENTICATION_ENABLED

View File

@ -177,7 +177,7 @@ def build_page_params_for_home_page_load(
# Adding two_fa_enabled as condition saves us 3 queries when
# 2FA is not enabled.
two_fa_enabled_user=two_fa_enabled and bool(default_device(user_profile)),
is_web_public_guest=user_profile is None,
is_web_public_visitor=user_profile is None,
)
undesired_register_ret_fields = [

View File

@ -459,10 +459,10 @@ Output:
and not for a logged-out web-public visitor."""
self.assertEqual(result.status_code, 200)
page_params = self._get_page_params(result)
# It is important to check `is_web_public_guest` to verify
# It is important to check `is_web_public_visitor` to verify
# that we treated this request as a normal logged-in session,
# not as a web-public visitor.
self.assertEqual(page_params['is_web_public_guest'], False)
self.assertEqual(page_params['is_web_public_visitor'], False)
def login_with_return(self, email: str, password: Optional[str]=None,
**kwargs: Any) -> HttpResponse:

View File

@ -85,7 +85,7 @@ class HomeTest(ZulipTestCase):
"is_admin",
"is_guest",
"is_owner",
"is_web_public_guest",
"is_web_public_visitor",
"jitsi_server_url",
"language_list",
"language_list_dbl_col",