add "your domain" to user's owned domain
This commit is contained in:
parent
784c265cdf
commit
8e7f5e56d6
|
@ -36,13 +36,17 @@
|
|||
{% if suffixes|length > 1 %}
|
||||
<select class="form-control" name="suffix">
|
||||
{% for suffix in suffixes %}
|
||||
<option value="{{ suffix }}">
|
||||
{{ suffix }}
|
||||
<option value="{{ suffix[1] }}">
|
||||
{% if suffix[0] %}
|
||||
{{ suffix[1] }} (your domain)
|
||||
{% else %}
|
||||
{{ suffix[1] }}
|
||||
{% endif %}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% else %}
|
||||
<span>{{ suffixes[0] }}</span>
|
||||
<span>{{ suffixes[0][1] }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -25,16 +25,17 @@ def custom_alias():
|
|||
return redirect(url_for("dashboard.index"))
|
||||
|
||||
user_custom_domains = [cd.domain for cd in current_user.verified_custom_domains()]
|
||||
# List of (is_custom_domain, alias-suffix)
|
||||
suffixes = []
|
||||
|
||||
# put custom domain first
|
||||
for alias_domain in user_custom_domains:
|
||||
suffixes.append("@" + alias_domain)
|
||||
suffixes.append((True, "@" + alias_domain))
|
||||
|
||||
# then default domain
|
||||
for domain in ALIAS_DOMAINS:
|
||||
suffixes.append(
|
||||
("" if DISABLE_ALIAS_SUFFIX else "." + random_word()) + "@" + domain
|
||||
(False, ("" if DISABLE_ALIAS_SUFFIX else "." + random_word()) + "@" + domain)
|
||||
)
|
||||
|
||||
if request.method == "POST":
|
||||
|
|
Loading…
Reference in a new issue