mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-22 16:31:15 -05:00
fix dao_get_jobs_by_service_id
statuses now defaults to correct val
This commit is contained in:
@@ -27,11 +27,11 @@ def dao_get_job_by_service_id_and_job_id(service_id, job_id):
|
||||
return Job.query.filter_by(service_id=service_id, id=job_id).one()
|
||||
|
||||
|
||||
def dao_get_jobs_by_service_id(service_id, limit_days=None, page=1, page_size=50, statuses=''):
|
||||
def dao_get_jobs_by_service_id(service_id, limit_days=None, page=1, page_size=50, statuses=None):
|
||||
query_filter = [Job.service_id == service_id]
|
||||
if limit_days is not None:
|
||||
query_filter.append(cast(Job.created_at, sql_date) >= days_ago(limit_days))
|
||||
if statuses != ['']:
|
||||
if statuses is not None and statuses != ['']:
|
||||
query_filter.append(
|
||||
Job.job_status.in_(statuses)
|
||||
)
|
||||
|
||||
@@ -313,6 +313,7 @@ JOB_STATUS_TYPES = [
|
||||
JOB_STATUS_CANCELLED
|
||||
]
|
||||
|
||||
|
||||
class JobStatus(db.Model):
|
||||
__tablename__ = 'job_status'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user