mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-24 08:16:19 -04:00
DRY-up conditionally creating callback tasks
This removes 3 duplicate instances of the same code, which is still
tested implicitly via test_process_ses_receipt_tasks [1]. In the
next commit we'll make this test more explicit, to reflect that it's
now being reused elsewhere and shouldn't change arbitrarily.
We do lose the "print" statement from the command instance of the
code, but I think that's a very tolerable loss.
[1]: 16ec8ccb8a/tests/app/celery/test_process_ses_receipts_tasks.py (L94)
This commit is contained in:
@@ -11,8 +11,8 @@ from app.config import QueueNames
|
||||
from app.dao import notifications_dao
|
||||
from app.models import NOTIFICATION_PENDING, NOTIFICATION_SENDING
|
||||
from app.notifications.notifications_ses_callback import (
|
||||
_check_and_queue_callback_task,
|
||||
_check_and_queue_complaint_callback_task,
|
||||
check_and_queue_callback_task,
|
||||
determine_notification_bounce_type,
|
||||
handle_complaint,
|
||||
)
|
||||
@@ -76,7 +76,7 @@ def process_ses_results(self, response):
|
||||
notification.sent_at
|
||||
)
|
||||
|
||||
_check_and_queue_callback_task(notification)
|
||||
check_and_queue_callback_task(notification)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user