mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 10:53:28 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user