MCPcopy
hub / github.com/django/django / send_messages

Method send_messages

django/core/mail/backends/console.py:29–46  ·  view source on GitHub ↗

Write all messages to the stream in a thread-safe way.

(self, email_messages)

Source from the content-addressed store, hash-verified

27 self.stream.write("\n")
28
29 def send_messages(self, email_messages):
30 """Write all messages to the stream in a thread-safe way."""
31 if not email_messages:
32 return
33 msg_count = 0
34 with self._lock:
35 try:
36 stream_created = self.open()
37 for message in email_messages:
38 self.write_message(message)
39 self.stream.flush() # flush after each message
40 msg_count += 1
41 if stream_created:
42 self.close()
43 except Exception:
44 if not self.fail_silently:
45 raise
46 return msg_count

Callers

nothing calls this directly

Calls 4

openMethod · 0.95
write_messageMethod · 0.95
closeMethod · 0.95
flushMethod · 0.45

Tested by

no test coverage detected