mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-04 10:21:14 -05:00
Move variable out of loop that didn't need to be
This commit is contained in:
@@ -419,6 +419,7 @@ def _move_notifications_to_notification_history(notification_type, service_id, d
|
|||||||
def _delete_letters_from_s3(
|
def _delete_letters_from_s3(
|
||||||
notification_type, service_id, date_to_delete_from, query_limit
|
notification_type, service_id, date_to_delete_from, query_limit
|
||||||
):
|
):
|
||||||
|
bucket_name = current_app.config['LETTERS_PDF_BUCKET_NAME']
|
||||||
letters_to_delete_from_s3 = db.session.query(
|
letters_to_delete_from_s3 = db.session.query(
|
||||||
Notification
|
Notification
|
||||||
).filter(
|
).filter(
|
||||||
@@ -427,7 +428,6 @@ def _delete_letters_from_s3(
|
|||||||
Notification.service_id == service_id
|
Notification.service_id == service_id
|
||||||
).limit(query_limit).all()
|
).limit(query_limit).all()
|
||||||
for letter in letters_to_delete_from_s3:
|
for letter in letters_to_delete_from_s3:
|
||||||
bucket_name = current_app.config['LETTERS_PDF_BUCKET_NAME']
|
|
||||||
# although letters without a `sent_at` timestamp do have PDFs, they do not exist in the
|
# although letters without a `sent_at` timestamp do have PDFs, they do not exist in the
|
||||||
# production-letters-pdf bucket as they never made it that far so we do not try and delete
|
# production-letters-pdf bucket as they never made it that far so we do not try and delete
|
||||||
# them from it
|
# them from it
|
||||||
|
|||||||
Reference in New Issue
Block a user