Start sending letters from insolvency service again

This commit is contained in:
Pea Tyczynska
2020-10-20 18:02:57 +01:00
parent c149f5020f
commit 9ac65ee95c
2 changed files with 2 additions and 34 deletions

View File

@@ -721,16 +721,12 @@ def dao_get_letters_to_be_printed(print_run_deadline, postage):
"""
Return all letters created before the print run deadline that have not yet been sent
"""
notifications = Notification.query.join(
Service,
Notification.service_id == Service.id
).filter(
notifications = Notification.query.filter(
Notification.created_at < convert_bst_to_utc(print_run_deadline),
Notification.notification_type == LETTER_TYPE,
Notification.status == NOTIFICATION_CREATED,
Notification.key_type == KEY_TYPE_NORMAL,
Notification.postage == postage,
or_(Service.organisation_id != 'f33fdfdd-7533-40cb-b5e8-cd78a1f5d21e', Service.organisation_id.is_(None)),
Notification.postage == postage
).order_by(
Notification.service_id,
Notification.created_at