Projet

Général

Profil

0001-ldap-fix-misleading-variable-timeBeforeExpiration-ex.patch

Loïc Dachary, 19 février 2021 09:08

Télécharger (2,45 ko)

Voir les différences:

Subject: [PATCH] ldap: fix misleading variable
 /timeBeforeExpiration/expiration_date/ (#51274)

The timeBeforeExpiration obtained from ppolicy is the number of
seconds left until the password expires. Before it is inserted in the
error message it is translated into a date because it is easier to
internationalize. The variable name should be changed to reflect this
modification otherwise it will be misleading to translators.

Fixes: #51274

License: MIT
 src/authentic2/backends/ldap_backend.py        | 6 +++---
 src/authentic2/locale/fr/LC_MESSAGES/django.po | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
src/authentic2/backends/ldap_backend.py
257 257
        return messages
258 258

  
259 259
    if ctrl.timeBeforeExpiration:
260
        timeBeforeExpiration = time.asctime(time.localtime(time.time() + ctrl.timeBeforeExpiration))
261
        messages.append(_('The password will expire at {timeBeforeExpiration}.').format(
262
            timeBeforeExpiration=timeBeforeExpiration))
260
        expiration_date = time.asctime(time.localtime(time.time() + ctrl.timeBeforeExpiration))
261
        messages.append(_('The password will expire at {expiration_date}.').format(
262
            expiration_date=expiration_date))
263 263
    if ctrl.graceAuthNsRemaining:
264 264
        messages.append(ngettext(
265 265
            'This password expired: this is the last time it can be used.',
src/authentic2/locale/fr/LC_MESSAGES/django.po
875 875

  
876 876
#: src/authentic2/backends/ldap_backend.py:261
877 877
#, python-brace-format
878
msgid "The password will expire at {timeBeforeExpiration}."
879
msgstr "Votre mot de passe ne sera plus valable dans {timeBeforeExpiration}."
878
msgid "The password will expire at {expiration_date}."
879
msgstr "Votre mot de passe ne sera plus valable le {expiration_date}."
880 880

  
881 881
#: src/authentic2/backends/ldap_backend.py:265
882 882
#, python-brace-format
883
-