mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
[WIP] Provide Default Email Timeout Value
This commit is contained in:
parent
3d9a47f0d9
commit
c9ac805eed
@ -22,6 +22,14 @@ class CustomEmailBackend(EmailBackend):
|
||||
recipient_parameter = "recipients"
|
||||
sender_parameter = "sender"
|
||||
|
||||
def __init__(self, timeout=None, **kwargs):
|
||||
self.timeout = timeout
|
||||
if timeout is None:
|
||||
self.timeout == 30
|
||||
if not (1 <= timeout <= 120):
|
||||
raise ValueError("Email timeout range needs to be between 1 and 120 seconds")
|
||||
return super(CustomEmailBackend, self).__init__(timeout, **kwargs)
|
||||
|
||||
def format_body(self, body):
|
||||
if "body" in body:
|
||||
body_actual = body['body']
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user