fix: disable the mail sending test when no SMTP server is configured

This commit is contained in:
Éloi Rivard 2024-11-13 10:58:11 +01:00
parent 8f3ea59a70
commit 08e0dd47bd
No known key found for this signature in database
GPG key ID: 7EDA204EA57DD184
2 changed files with 47 additions and 31 deletions

View file

@ -38,21 +38,33 @@
</div>
</h2>
<div class="ui info message">
{% trans %}
This form will send a dummy email to the address you want.
This should be used for testing mail configuration.
{% endtrans %}
</div>
{% if features.has_smtp %}
{% call fui.render_form(form) %}
{{ fui.render_field(form.email) }}
<div class="ui right aligned container">
<div class="ui stackable buttons">
<input type="submit" class="ui primary button" value="{{ _("Send") }}">
</div>
<div class="ui info message">
{% trans %}
This form will send a dummy email to the address you want.
This should be used for testing mail configuration.
{% endtrans %}
</div>
{% endcall %}
{% call fui.render_form(form) %}
{{ fui.render_field(form.email) }}
<div class="ui right aligned container">
<div class="ui stackable buttons">
<input type="submit" class="ui primary button" value="{{ _("Send") }}">
</div>
</div>
{% endcall %}
{% else %}
<div class="ui warning message">
{% trans %}
No mail server has been configured. The mail sending test is disabled.
{% endtrans %}
</div>
{% endif %}
</div>
<div class="ui segment">

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2024-10-28 11:57+0100\n"
"POT-Creation-Date: 2024-11-13 10:57+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -17,35 +17,35 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.16.0\n"
#: canaille/app/flask.py:100
#: canaille/app/flask.py:53
msgid "No SMTP server has been configured"
msgstr ""
#: canaille/app/forms.py:27
#: canaille/app/forms.py:26
msgid "This is not a valid URL"
msgstr ""
#: canaille/app/forms.py:34 canaille/app/forms.py:35
#: canaille/app/forms.py:33 canaille/app/forms.py:34
msgid "This value is a duplicate"
msgstr ""
#: canaille/app/forms.py:47
#: canaille/app/forms.py:46
msgid "Not a valid phone number"
msgstr ""
#: canaille/app/forms.py:55
#: canaille/app/forms.py:54
msgid "Field must be at least {minimum_password_length} characters long."
msgstr ""
#: canaille/app/forms.py:67
#: canaille/app/forms.py:66
msgid "Field cannot be longer than {maximum_password_length} characters."
msgstr ""
#: canaille/app/forms.py:240
#: canaille/app/forms.py:244
msgid "The page number is not valid"
msgstr ""
#: canaille/app/forms.py:268
#: canaille/app/forms.py:272
msgid "Not a valid datetime value."
msgstr ""
@ -666,7 +666,7 @@ msgid "Send again"
msgstr ""
#: canaille/core/templates/forgotten-password.html:48
#: canaille/core/templates/mails/admin.html:52
#: canaille/core/templates/mails/admin.html:54
msgid "Send"
msgstr ""
@ -987,7 +987,7 @@ msgstr ""
msgid "The user will not be able to authenticate unless the password is set"
msgstr ""
#: canaille/core/templates/mails/admin.html:97
#: canaille/core/templates/mails/admin.html:109
#: canaille/core/templates/mails/reset.html:19
#: canaille/core/templates/profile_settings.html:116
#: canaille/core/templates/reset-password.html:12
@ -1102,38 +1102,42 @@ msgstr ""
msgid "Mail sending test"
msgstr ""
#: canaille/core/templates/mails/admin.html:42
#: canaille/core/templates/mails/admin.html:44
msgid ""
"This form will send a dummy email to the address you want. This should be"
" used for testing mail configuration."
msgstr ""
#: canaille/core/templates/mails/admin.html:61
msgid "Email preview"
#: canaille/core/templates/mails/admin.html:62
msgid "No mail server has been configured. The mail sending test is disabled."
msgstr ""
#: canaille/core/templates/mails/admin.html:73
msgid "Email preview"
msgstr ""
#: canaille/core/templates/mails/admin.html:85
#: canaille/core/templates/mails/test.html:19
#: canaille/core/templates/mails/test.txt:1
msgid "Connectivity test"
msgstr ""
#: canaille/core/templates/mails/admin.html:85
#: canaille/core/templates/mails/admin.html:97
#: canaille/core/templates/mails/firstlogin.html:19
#: canaille/core/templates/mails/reset.txt:1
msgid "Password initialization"
msgstr ""
#: canaille/core/templates/mails/admin.html:109
#: canaille/core/templates/mails/admin.html:121
#: canaille/core/templates/mails/email-confirmation.txt:1
msgid "Email verification"
msgstr ""
#: canaille/core/templates/mails/admin.html:121
#: canaille/core/templates/mails/admin.html:133
msgid "Invitation"
msgstr ""
#: canaille/core/templates/mails/admin.html:133
#: canaille/core/templates/mails/admin.html:145
#: canaille/core/templates/mails/registration.html:19
#: canaille/core/templates/mails/registration.txt:1
msgid "Registration"