mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-02 17:31:14 -05:00
Remove unused column from query
This commit is contained in:
@@ -234,9 +234,8 @@ def check_templated_letter_state():
|
|||||||
|
|
||||||
@notify_celery.task(name='check-for-missing-rows-in-completed-jobs')
|
@notify_celery.task(name='check-for-missing-rows-in-completed-jobs')
|
||||||
def check_for_missing_rows_in_completed_jobs():
|
def check_for_missing_rows_in_completed_jobs():
|
||||||
jobs_and_job_size = find_jobs_with_missing_rows()
|
jobs = find_jobs_with_missing_rows()
|
||||||
for x in jobs_and_job_size:
|
for job in jobs:
|
||||||
job = x[1]
|
|
||||||
recipient_csv, template, sender_id = get_recipient_csv_and_template_and_sender_id(job)
|
recipient_csv, template, sender_id = get_recipient_csv_and_template_and_sender_id(job)
|
||||||
missing_rows = find_missing_row_for_job(job.id, job.notification_count)
|
missing_rows = find_missing_row_for_job(job.id, job.notification_count)
|
||||||
for row_to_process in missing_rows:
|
for row_to_process in missing_rows:
|
||||||
|
|||||||
@@ -214,7 +214,6 @@ def find_jobs_with_missing_rows():
|
|||||||
ten_minutes_ago = datetime.utcnow() - timedelta(minutes=10)
|
ten_minutes_ago = datetime.utcnow() - timedelta(minutes=10)
|
||||||
yesterday = datetime.utcnow() - timedelta(days=1)
|
yesterday = datetime.utcnow() - timedelta(days=1)
|
||||||
jobs_with_rows_missing = db.session.query(
|
jobs_with_rows_missing = db.session.query(
|
||||||
func.count(Notification.id).label('actual_count'),
|
|
||||||
Job
|
Job
|
||||||
).filter(
|
).filter(
|
||||||
Job.job_status == JOB_STATUS_FINISHED,
|
Job.job_status == JOB_STATUS_FINISHED,
|
||||||
|
|||||||
@@ -461,8 +461,7 @@ def test_find_jobs_with_missing_rows(sample_email_template):
|
|||||||
results = find_jobs_with_missing_rows()
|
results = find_jobs_with_missing_rows()
|
||||||
|
|
||||||
assert len(results) == 1
|
assert len(results) == 1
|
||||||
assert results[0].actual_count == 4
|
assert results[0] == job_with_missing_rows
|
||||||
assert results[0][1] == job_with_missing_rows
|
|
||||||
|
|
||||||
|
|
||||||
def test_find_jobs_with_missing_rows_returns_nothing_for_a_job_completed_less_than_10_minutes_ago(
|
def test_find_jobs_with_missing_rows_returns_nothing_for_a_job_completed_less_than_10_minutes_ago(
|
||||||
|
|||||||
Reference in New Issue
Block a user