Projet

Général

Profil

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

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

Télécharger (1,68 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 +++---
 1 file changed, 3 insertions(+), 3 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.',
266
-