Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

home: Simplify and comment terms of service notice implementation.

Tim Abbottde411be576db
diff --git a/zerver/context_processors.py b/zerver/context_processors.py
index 1ca8702cd9e..3e0278e4ae8 100644
--- a/zerver/context_processors.py
+++ b/zerver/context_processors.py
@@ -176,7 +176,6 @@ def zulip_default_context(request: HttpRequest) -> Dict[str, Any]:
"platform": RequestNotes.get_notes(request).client_name,
"allow_search_engine_indexing": allow_search_engine_indexing,
"landing_page_navbar_message": settings.LANDING_PAGE_NAVBAR_MESSAGE,
- "terms_of_service_message": settings.TERMS_OF_SERVICE_MESSAGE,
"is_isolated_page": is_isolated_page(request),
"default_page_params": default_page_params,
}
diff --git a/zerver/views/home.py b/zerver/views/home.py
index 58a13afed85..c8028637963 100644
--- a/zerver/views/home.py
+++ b/zerver/views/home.py
@@ -44,21 +44,28 @@ def accounts_accept_terms(request: HttpRequest) -> HttpResponse:
else:
form = ToSForm()
- email = request.user.delivery_email
- first_time_terms_of_service_message_template = None
+ context = {
+ "form": form,
+ "email": request.user.delivery_email,
+ # Text displayed when updating TERMS_OF_SERVICE_VERSION.
+ "terms_of_service_message": settings.TERMS_OF_SERVICE_MESSAGE,
+ # HTML template used when agreeing to terms of service the
+ # first time, e.g. after data import.
+ "first_time_terms_of_service_message_template": None,
+ }
+
if (
request.user.tos_version is None
and settings.FIRST_TIME_TERMS_OF_SERVICE_TEMPLATE is not None
):
- first_time_terms_of_service_message_template = settings.FIRST_TIME_TERMS_OF_SERVICE_TEMPLATE
+ context[
+ "first_time_terms_of_service_message_template"
+ ] = settings.FIRST_TIME_TERMS_OF_SERVICE_TEMPLATE
+
return render(
request,
"zerver/accounts_accept_terms.html",
- context={
- "form": form,
- "email": email,
- "first_time_terms_of_service_message_template": first_time_terms_of_service_message_template,
- },
+ context,
)