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

@@ -2,11 +2,10 @@ from datetime import datetime
import pytz
from dateutil import parser
from flask import current_app
def get_current_financial_year():
now = datetime.now(current_app.config['PY_TIMEZONE'])
now = datetime.now(pytz.utc)
current_month = int(now.strftime('%-m'))
current_year = int(now.strftime('%Y'))
return current_year if current_month > 9 else current_year - 1