misc: fix "remotre" typo in authenticator condition (#77834)
gitea/authentic/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2023-05-23 13:30:10 +02:00
parent 1e9c56fbc2
commit 1bf323769c
4 changed files with 7 additions and 7 deletions

View File

@ -36,7 +36,7 @@ class Migration(migrations.Migration):
default='',
help_text=(
'Django template controlling authenticator display. For example, "\'backoffice\' '
'in login_hint or remotre_addr == \'1.2.3.4\'" would hide the authenticator from '
'in login_hint or remote_addr == \'1.2.3.4\'" would hide the authenticator from '
'normal users except if they come from the specified IP address. Available '
'variables include service_ou_slug, service_slug, remote_addr, login_hint and '
'headers.'

View File

@ -64,7 +64,7 @@ class BaseAuthenticator(models.Model):
default='',
help_text=_(
'Django template controlling authenticator display. For example, "\'backoffice\' in '
'login_hint or remotre_addr == \'1.2.3.4\'" would hide the authenticator from normal users '
'login_hint or remote_addr == \'1.2.3.4\'" would hide the authenticator from normal users '
'except if they come from the specified IP address. Available variables include '
'service_ou_slug, service_slug, remote_addr, login_hint and headers.'
),

View File

@ -810,13 +810,13 @@ msgstr "Condition daffichage"
#: src/authentic2/apps/authenticators/models.py
msgid ""
"Django template controlling authenticator display. For example, "
"\"'backoffice' in login_hint or remotre_addr == '1.2.3.4'\" would hide the "
"\"'backoffice' in login_hint or remote_addr == '1.2.3.4'\" would hide the "
"authenticator from normal users except if they come from the specified IP "
"address. Available variables include service_ou_slug, service_slug, "
"remote_addr, login_hint and headers."
msgstr ""
"Gabarit pour contrôler laffichage du moyen dauthentification. Par exemple, "
"« 'backoffice' in login_hint or remotre_addr == '1.2.3.4' » le masquera aux "
"« 'backoffice' in login_hint or remote_addr == '1.2.3.4' » le masquera aux "
"yeux des usagers sauf s'ils viennent de ladresse IP spécifiée. Les "
"variables disponibles sont : include service_ou_slug, service_slug, "
"remote_addr, login_hint et headers."

View File

@ -88,18 +88,18 @@ def test_authenticators_password(app, superuser_or_admin):
resp = resp.form.submit()
assert "could not parse expression: unmatched" in resp.text
resp.form['show_condition'] = "'backoffice' in login_hint or remotre_addr == '1.2.3.4'"
resp.form['show_condition'] = "'backoffice' in login_hint or remote_addr == '1.2.3.4'"
resp = resp.form.submit().follow()
assert 'Click "Edit" to change configuration.' not in resp.text
if DJ_VERSION[0] <= 2:
assert (
"Show condition: &#39;backoffice&#39; in login_hint or remotre_addr == &#39;1.2.3.4&#39;"
"Show condition: &#39;backoffice&#39; in login_hint or remote_addr == &#39;1.2.3.4&#39;"
in resp.text
)
else:
# html-rendered quote characters change in django 3 onwards…
assert (
"Show condition: &#x27;backoffice&#x27; in login_hint or remotre_addr == &#x27;1.2.3.4&#x27;"
"Show condition: &#x27;backoffice&#x27; in login_hint or remote_addr == &#x27;1.2.3.4&#x27;"
in resp.text
)
assert_event('authenticator.edit', user=superuser_or_admin, session=app.session)