Merge pull request #953 from simple-login/fix-default-domain

handle case user doesn't have default domain for alias
This commit is contained in:
Adrià Casajús 2022-05-12 11:18:53 +02:00 committed by GitHub
commit dde25678cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -274,10 +274,14 @@
<form method="post" action="#random-alias" class="form-inline"> <form method="post" action="#random-alias" class="form-inline">
<input type="hidden" name="form-name" value="change-random-alias-default-domain"> <input type="hidden" name="form-name" value="change-random-alias-default-domain">
<select class="form-control mr-sm-2" name="random-alias-default-domain"> <select class="form-control mr-sm-2" name="random-alias-default-domain">
<option value="">Not Selected</option>
{% for is_public, domain in current_user.available_domains_for_random_alias() %} {% for is_public, domain in current_user.available_domains_for_random_alias() %}
<option value="{{ domain }}" <option value="{{ domain }}"
{% if current_user.default_random_alias_domain() == domain %} selected {% endif %} > {% if current_user.default_alias_custom_domain_id or current_user.default_alias_public_domain_id %}
{{ domain }} ({% if is_public %} SimpleLogin domain {% else %} your domain {% endif %}) {% if current_user.default_random_alias_domain() == domain %} selected {% endif %}
{% endif %}
>
{{ domain }} ({% if is_public %} SimpleLogin domain {% else %} your domain {% endif %})
</option> </option>
{% endfor %} {% endfor %}
</select> </select>
@ -565,7 +569,7 @@
<div class="form-check"> <div class="form-check">
<input type="checkbox" id="include-sender-header" name="enable" <input type="checkbox" id="include-sender-header" name="enable"
{% if current_user.include_header_email_header %} checked {% endif %} class="form-check-input"> {% if current_user.include_header_email_header %} checked {% endif %} class="form-check-input">
<label for="include-sender-header">Include sender address in email headers</label> <label for="include-sender-header">Include sender address in email headers</label>
</div> </div>