request: Store client information using ZulipRequestNotes.

This concludes the HttpRequest migration to eliminate arbitrary
attributes (except private ones that are belong to django) attached
to the request object during runtime and migrated them to a
separate data structure dedicated for the purpose of adding
information (so called notes) to a HttpRequest.
This commit is contained in:
PIG208
2021-07-10 00:10:51 +08:00
committed by Tim Abbott
parent 26875cdf0b
commit c03b9c95ad
20 changed files with 89 additions and 55 deletions

View File

@@ -16,6 +16,7 @@ from zerver.lib.i18n import (
get_language_list,
get_language_translation_data,
)
from zerver.lib.request import get_request_notes
from zerver.models import Message, Realm, Stream, UserProfile
from zerver.views.message_flags import get_latest_update_message_flag_activity
@@ -138,9 +139,11 @@ def build_page_params_for_home_page_load(
}
if user_profile is not None:
client = get_request_notes(request).client
assert client is not None
register_ret = do_events_register(
user_profile,
request.client,
client,
apply_markdown=True,
client_gravatar=True,
slim_presence=True,