mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 18:01:08 -05:00
Merge pull request #347 from alphagov/get-jobs-created-in-last-7-days
Add a limit days query param for get all jobs.
This commit is contained in:
@@ -11,6 +11,7 @@ from flask import current_app
|
||||
from werkzeug.datastructures import MultiDict
|
||||
|
||||
from app import db
|
||||
from app.dao import days_ago
|
||||
from app.models import (
|
||||
Service,
|
||||
Notification,
|
||||
@@ -342,7 +343,3 @@ def delete_notifications_created_more_than_a_week_ago(status):
|
||||
).delete(synchronize_session='fetch')
|
||||
db.session.commit()
|
||||
return deleted
|
||||
|
||||
|
||||
def days_ago(number_of_days):
|
||||
return date.today() - timedelta(days=number_of_days)
|
||||
|
||||
Reference in New Issue
Block a user