1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-11-25 02:47:04 +00:00

Fixed C404 (unnecessary-list-comprehension-dict): Unnecessary list comprehension (rewrite as a dict comprehension)

This commit is contained in:
Teal Dulcet 2023-12-22 07:24:11 -08:00 committed by Joshua Tauberer
parent fd4fcdaf53
commit 54af4725f9

View File

@ -489,7 +489,7 @@ def check_primary_hostname_dns(domain, env, output, dns_domains, dns_zonefiles):
check_alias_exists("Hostmaster contact address", "hostmaster@" + domain, env, output) check_alias_exists("Hostmaster contact address", "hostmaster@" + domain, env, output)
def check_alias_exists(alias_name, alias, env, output): def check_alias_exists(alias_name, alias, env, output):
mail_aliases = dict([(address, receivers) for address, receivers, *_ in get_mail_aliases(env)]) mail_aliases = {address: receivers for address, receivers, *_ in get_mail_aliases(env)}
if alias in mail_aliases: if alias in mail_aliases:
if mail_aliases[alias]: if mail_aliases[alias]:
output.print_ok("{} exists as a mail alias. [{}{}]".format(alias_name, alias, mail_aliases[alias])) output.print_ok("{} exists as a mail alias. [{}{}]".format(alias_name, alias, mail_aliases[alias]))