Fix available_suffixes_more_info
This commit is contained in:
parent
abb3ec1f05
commit
7915a2abb9
|
@ -92,15 +92,18 @@ def available_suffixes_more_info(user: User) -> [SuffixInfo]:
|
||||||
# for each user domain, generate both the domain and a random suffix version
|
# for each user domain, generate both the domain and a random suffix version
|
||||||
for custom_domain in user_custom_domains:
|
for custom_domain in user_custom_domains:
|
||||||
suffix = "@" + custom_domain.domain
|
suffix = "@" + custom_domain.domain
|
||||||
suffixes.append(SuffixInfo(True, suffix, signer.sign(suffix).decode(), False))
|
suffix_info = SuffixInfo(True, suffix, signer.sign(suffix).decode(), False)
|
||||||
|
|
||||||
|
# put the default domain to top
|
||||||
|
if user.default_alias_custom_domain_id == custom_domain.id:
|
||||||
|
suffixes.insert(0, suffix_info)
|
||||||
|
else:
|
||||||
|
suffixes.append(suffix_info)
|
||||||
|
|
||||||
if custom_domain.random_prefix_generation:
|
if custom_domain.random_prefix_generation:
|
||||||
suffix = "." + random_word() + "@" + custom_domain.domain
|
suffix = "." + random_word() + "@" + custom_domain.domain
|
||||||
suffix_info = SuffixInfo(True, suffix, signer.sign(suffix).decode(), False)
|
suffix_info = SuffixInfo(True, suffix, signer.sign(suffix).decode(), False)
|
||||||
# put the default domain to top
|
suffixes.append(suffix_info)
|
||||||
if user.default_alias_custom_domain_id == custom_domain.id:
|
|
||||||
suffixes.insert(0, suffix_info)
|
|
||||||
else:
|
|
||||||
suffixes.append(suffix_info)
|
|
||||||
|
|
||||||
# then SimpleLogin domain
|
# then SimpleLogin domain
|
||||||
for sl_domain in user.get_sl_domains():
|
for sl_domain in user.get_sl_domains():
|
||||||
|
|
Loading…
Reference in a new issue