letsencrypt: Fix problem with automatically obtaining certificates

When a domain is added, an attempt will be made to obtain a valid LE certificate
for domain.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-08-11 18:40:00 -04:00
1 parent 8ece36893c
commit ba8db1b4b5
1 file changed
+3 -3
+3 -3
View File
@@ -165,9 +165,9 @@ def on_domain_added(sender, domain_type='', name='', description='',
# Check if a cert if already available
for domain_name, domain_status in get_status()['domains'].items():
if domain_name == name and \
domain_status.certificate_available and \
domain_status.validity == 'valid':
if domain_name == name and domain_status and \
domain_status['certificate_available'] and \
domain_status['validity'] == 'valid':
return False
try: