mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 18:23:01 -04:00
remove datetime.utcnow()
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from datetime import date, datetime, timedelta
|
||||
from datetime import date, timedelta
|
||||
|
||||
from flask import current_app
|
||||
from sqlalchemy import Date, Integer, and_, desc, func, union
|
||||
@@ -18,7 +18,7 @@ from app.models import (
|
||||
Rate,
|
||||
Service,
|
||||
)
|
||||
from app.utils import get_midnight_in_utc
|
||||
from app.utils import get_midnight_in_utc, utc_now
|
||||
|
||||
|
||||
def fetch_sms_free_allowance_remainder_until_date(end_date):
|
||||
@@ -198,7 +198,7 @@ def fetch_monthly_billing_for_year(service_id, year):
|
||||
we also update the table on-the-fly if we need accurate data for this year.
|
||||
"""
|
||||
_, year_end = get_calendar_year_dates(year)
|
||||
today = datetime.utcnow().date()
|
||||
today = utc_now().date()
|
||||
|
||||
# if year end date is less than today, we are calculating for data in the past and have no need for deltas.
|
||||
if year_end >= today:
|
||||
@@ -535,7 +535,7 @@ def update_fact_billing(data, process_day):
|
||||
set_={
|
||||
"notifications_sent": stmt.excluded.notifications_sent,
|
||||
"billable_units": stmt.excluded.billable_units,
|
||||
"updated_at": datetime.utcnow(),
|
||||
"updated_at": utc_now(),
|
||||
},
|
||||
)
|
||||
db.session.connection().execute(stmt)
|
||||
@@ -699,7 +699,7 @@ def query_organization_sms_usage_for_year(organization_id, year):
|
||||
|
||||
def fetch_usage_year_for_organization(organization_id, year):
|
||||
year_start, year_end = get_calendar_year_dates(year)
|
||||
today = datetime.utcnow().date()
|
||||
today = utc_now().date()
|
||||
services = dao_get_organization_live_services(organization_id)
|
||||
|
||||
# if year end date is less than today, we are calculating for data in the past and have no need for deltas.
|
||||
|
||||
Reference in New Issue
Block a user