mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-03-18 18:07:22 +01:00
Fixed SIM108 (if-else-block-instead-of-if-exp)
This commit is contained in:
committed by
Joshua Tauberer
parent
51dc7615f7
commit
fba92de051
@@ -861,10 +861,7 @@ def filter_custom_records(domain, custom_dns_iter):
|
||||
# our short form (None => domain, or a relative QNAME) if
|
||||
# domain is not None.
|
||||
if domain is not None:
|
||||
if qname == domain:
|
||||
qname = None
|
||||
else:
|
||||
qname = qname[0:len(qname)-len("." + domain)]
|
||||
qname = None if qname == domain else qname[0:len(qname) - len("." + domain)]
|
||||
|
||||
yield (qname, rtype, value)
|
||||
|
||||
@@ -1094,10 +1091,7 @@ def build_recommended_dns(env):
|
||||
|
||||
# expand qnames
|
||||
for i in range(len(records)):
|
||||
if records[i][0] == None:
|
||||
qname = domain
|
||||
else:
|
||||
qname = records[i][0] + "." + domain
|
||||
qname = domain if records[i][0] == None else records[i][0] + "." + domain
|
||||
|
||||
records[i] = {
|
||||
"qname": qname,
|
||||
|
||||
Reference in New Issue
Block a user