From 50e67d2308a89ae8b102ada7bf05811bde711bd9 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Fri, 23 Aug 2024 12:21:43 -0700 Subject: [PATCH] cleanup --- app/main/views/dashboard.py | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/app/main/views/dashboard.py b/app/main/views/dashboard.py index cc65106c9..fea3e3ece 100644 --- a/app/main/views/dashboard.py +++ b/app/main/views/dashboard.py @@ -6,7 +6,7 @@ from itertools import groupby from flask import ( Response, abort, - app, + current_app, jsonify, render_template, request, @@ -292,19 +292,6 @@ def inbox_download(service_id): ) -@main.route("/get-timezone", methods=["POST", "GET"]) -def get_timezone(): - print(hilite("ENTER GET-TIMEZONE")) - timezone = request.cookies.get("timezone", "UTC") - print(hilite(f"TIMEZONE {timezone}")) - # data = request.get_json() - # print(f"HEY DATA WAS {data}") - # timezone = data.get('timezone') - # print(hilite(f"TIMEZONE = {timezone}")) - # session['timezone'] = timezone - return jsonify({"message": f"Timezone get successfully {timezone}"}), 200 - - def get_inbox_partials(service_id): page = int(request.args.get("page", 1)) inbound_messages_data = service_api_client.get_most_recent_inbound_sms( @@ -425,9 +412,9 @@ def get_dashboard_partials(service_id): def get_dashboard_totals(statistics): - - timezone = request.cookies.get("timezone", "UTC") - print(hilite(f"HURRAY TIMEZONE IS {timezone}")) + # This is set in dashboard.html on page load + timezone = request.cookies.get("timezone", "US/Eastern") + current_app.logger.debug(hilite(f"User's timezone is {timezone}")) if current_user.preferred_timezone is not timezone: current_user.update(preferred_timezone=timezone)