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,6 +38,8 @@
</div> </div>
</h2> </h2>
{% if features.has_smtp %}
<div class="ui info message"> <div class="ui info message">
{% trans %} {% trans %}
This form will send a dummy email to the address you want. This form will send a dummy email to the address you want.
@ -53,6 +55,16 @@
</div> </div>
</div> </div>
{% endcall %} {% 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>
<div class="ui segment"> <div class="ui segment">

View file

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