##// END OF EJS Templates
fix(mailing): don't default to empty string for smtp_password and user, since mailing lib only expects None as empty values
super-admin -
r5488:186b51dd default
parent child Browse files
Show More
@@ -1,4 +1,4 b''
1 # Copyright (C) 2012-2023 RhodeCode GmbH
1 # Copyright (C) 2012-2024 RhodeCode GmbH
2 2 #
3 3 # This program is free software: you can redistribute it and/or modify
4 4 # it under the terms of the GNU Affero General Public License, version 3
@@ -64,8 +64,9 b' def send_email(recipients, subject, body'
64 64 "Make sure that `smtp_server` variable is configured "
65 65 "inside the .ini file")
66 66 return False
67
68 subject = "%s %s" % (email_config.get('email_prefix', ''), subject)
67 conf_prefix = email_config.get('email_prefix', None)
68 prefix = f'{conf_prefix} ' if conf_prefix else ''
69 subject = f"{prefix}{subject}"
69 70
70 71 if recipients:
71 72 if isinstance(recipients, str):
@@ -86,8 +87,8 b' def send_email(recipients, subject, body'
86 87 email_conf = dict(
87 88 host=mail_server,
88 89 port=email_config.get('smtp_port', 25),
89 username=email_config.get('smtp_username'),
90 password=email_config.get('smtp_password'),
90 username=email_config.get('smtp_username', None),
91 password=email_config.get('smtp_password', None),
91 92
92 93 tls=str2bool(email_config.get('smtp_use_tls')),
93 94 ssl=str2bool(email_config.get('smtp_use_ssl')),
General Comments 0
You need to be logged in to leave comments. Login now