mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-24 16:23:44 -04:00
tz utility swap and many test updates
This commit is contained in:
@@ -66,7 +66,7 @@ from app.models import (
|
||||
Service,
|
||||
User,
|
||||
)
|
||||
from app.utils import get_london_midnight_in_utc
|
||||
from app.utils import get_local_midnight_in_utc
|
||||
|
||||
|
||||
@click.group(name='command', help='Additional commands')
|
||||
@@ -213,8 +213,8 @@ def rebuild_ft_billing_for_day(service_id, day):
|
||||
rebuild_ft_data(day, service_id)
|
||||
else:
|
||||
services = get_service_ids_that_need_billing_populated(
|
||||
get_london_midnight_in_utc(day),
|
||||
get_london_midnight_in_utc(day + timedelta(days=1))
|
||||
get_local_midnight_in_utc(day),
|
||||
get_local_midnight_in_utc(day + timedelta(days=1))
|
||||
)
|
||||
for row in services:
|
||||
rebuild_ft_data(day, row.service_id)
|
||||
@@ -325,9 +325,9 @@ def update_jobs_archived_flag(start_date, end_date):
|
||||
sql = """update
|
||||
jobs set archived = true
|
||||
where
|
||||
created_at >= (date :start + time '00:00:00') at time zone 'Europe/London'
|
||||
created_at >= (date :start + time '00:00:00') at time zone 'America/New_York'
|
||||
at time zone 'UTC'
|
||||
and created_at < (date :end + time '00:00:00') at time zone 'Europe/London' at time zone 'UTC'"""
|
||||
and created_at < (date :end + time '00:00:00') at time zone 'America/New_York' at time zone 'UTC'"""
|
||||
|
||||
result = db.session.execute(sql, {"start": process_date, "end": process_date + timedelta(days=1)})
|
||||
db.session.commit()
|
||||
|
||||
Reference in New Issue
Block a user