mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
email_senders: Handle a None realm_id.
Some codepaths send an event with `realm_id=None` -- which we still must trim out of the event, even if we do not add a `realm` value for them.
This commit is contained in:
committed by
Tim Abbott
parent
42360c9477
commit
198a5a8294
@@ -64,9 +64,10 @@ class EmailSendingWorker(LoopQueueProcessingWorker):
|
||||
if "failed_tries" in copied_event:
|
||||
del copied_event["failed_tries"]
|
||||
handle_send_email_format_changes(copied_event)
|
||||
if copied_event.get("realm_id") is not None:
|
||||
if "realm_id" in copied_event:
|
||||
# "realm" does not serialize over the queue, so we send the realm_id
|
||||
copied_event["realm"] = Realm.objects.get(id=copied_event["realm_id"])
|
||||
if copied_event.get("realm_id") is not None:
|
||||
copied_event["realm"] = Realm.objects.get(id=copied_event["realm_id"])
|
||||
del copied_event["realm_id"]
|
||||
self.connection = initialize_connection(self.connection)
|
||||
send_immediate_email(**copied_event, connection=self.connection)
|
||||
|
||||
Reference in New Issue
Block a user