Adding service_id to the sort order for the letters being sent to print.

We have had a few instances where letters have caused problems. Particularly for precompiled letters, often the issue comes from the same service.
The hope is that by adding a sort order this will help the print provider narrow down the problem.

There is a small degradation of the performance of the query, but it's not enough to concern me.
This commit is contained in:
Rebecca Law
2020-10-15 09:39:07 +01:00
parent 50982ff36a
commit b2ff4277c9
2 changed files with 16 additions and 1 deletions

View File

@@ -728,6 +728,7 @@ def dao_get_letters_to_be_printed(print_run_deadline, postage):
Notification.key_type == KEY_TYPE_NORMAL,
Notification.postage == postage,
).order_by(
Notification.service_id,
Notification.created_at
).all()
return notifications