Remove PY_TIMEZONE references (#547)

This changeset removes the PY_TIMEZONE configuration variable and updates all references to it to refer directly to pytz.utc instead.  It also cleans up a few of the import statements and removes those that are no longer needed (like the current_app reference from Flask).

Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
Carlo Costino
2023-06-12 17:00:20 -04:00
committed by GitHub
parent 92d25f5a69
commit 63a97b9780
5 changed files with 16 additions and 17 deletions

View File

@@ -3,7 +3,8 @@ from itertools import groupby
from operator import itemgetter
from statistics import mean
from flask import current_app, render_template
import pytz
from flask import render_template
from app import performance_dashboard_api_client, status_api_client
from app.main import main
@@ -12,8 +13,8 @@ from app.main import main
@main.route("/performance")
def performance():
stats = performance_dashboard_api_client.get_performance_dashboard_stats(
start_date=(datetime.now(current_app.config['PY_TIMEZONE']) - timedelta(days=7)).date(),
end_date=datetime.now(current_app.config['PY_TIMEZONE']).date(),
start_date=(datetime.now(pytz.utc) - timedelta(days=7)).date(),
end_date=datetime.now(pytz.utc).date(),
)
stats['organisations_using_notify'] = sorted(
[