From 0ad17925ebdbe13b5ebadfeca762a08948d2fedf Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Mon, 26 Apr 2021 16:51:50 -0700 Subject: [PATCH] send_email: Remove unnecessary send_email_from_dict. This was introduced in 8321bd3f927d to serve as a sort of drop-in replacement for zerver.lib.queue.queue_json_publish, but its use has been subsequently cut out (e.g. `9fcdb6c83ac5`). Remote its last callsite. --- zerver/lib/send_email.py | 4 ---- zerver/worker/queue_processors.py | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/zerver/lib/send_email.py b/zerver/lib/send_email.py index 7770832e79..77f0d9ca74 100644 --- a/zerver/lib/send_email.py +++ b/zerver/lib/send_email.py @@ -227,10 +227,6 @@ def send_email( raise EmailNotDeliveredException -def send_email_from_dict(email_dict: Mapping[str, Any]) -> None: - send_email(**dict(email_dict)) - - def send_future_email( template_prefix: str, realm: Realm, diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index 1728a605d4..20a4305158 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -82,7 +82,7 @@ from zerver.lib.send_email import ( EmailNotDeliveredException, FromAddress, handle_send_email_format_changes, - send_email_from_dict, + send_email, send_future_email, ) from zerver.lib.timestamp import timestamp_to_datetime @@ -613,13 +613,13 @@ class EmailSendingWorker(QueueProcessingWorker): @retry_send_email_failures def consume(self, event: Dict[str, Any]) -> None: # Copy the event, so that we don't pass the `failed_tries' - # data to send_email_from_dict (which neither takes that + # data to send_email (which neither takes that # argument nor needs that data). copied_event = copy.deepcopy(event) if "failed_tries" in copied_event: del copied_event["failed_tries"] handle_send_email_format_changes(copied_event) - send_email_from_dict(copied_event) + send_email(**copied_event) @assign_queue("missedmessage_mobile_notifications")