mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2024-11-22 02:17:26 +00:00
utils.sort_domains wasn't right
This commit is contained in:
parent
1a74b81f44
commit
deebda06e1
@ -40,7 +40,7 @@ def sort_domains(domain_names, env):
|
|||||||
# Within each group, sort parent domains before subdomains and after that sort lexicographically.
|
# Within each group, sort parent domains before subdomains and after that sort lexicographically.
|
||||||
def sort_group(group):
|
def sort_group(group):
|
||||||
# Find the top-most domains.
|
# Find the top-most domains.
|
||||||
top_domains = sorted(d for d in group if len([s for s in group if s.startswith("." + d)]) == 0)
|
top_domains = sorted(d for d in group if len([s for s in group if d.endswith("." + s)]) == 0)
|
||||||
ret = []
|
ret = []
|
||||||
for d in top_domains:
|
for d in top_domains:
|
||||||
ret.append(d)
|
ret.append(d)
|
||||||
|
Loading…
Reference in New Issue
Block a user