Projet

Général

Profil

0003-utils-misc-add-sms-code-creation-utilitary-function-.patch

Paul Marillonnet, 13 octobre 2022 14:06

Télécharger (912 octets)

Voir les différences:

Subject: [PATCH 03/10] utils/misc: add sms code creation utilitary function
 (#69223)

 src/authentic2/utils/misc.py | 9 +++++++++
 1 file changed, 9 insertions(+)
src/authentic2/utils/misc.py
1341 1341
    )
1342 1342

  
1343 1343

  
1344
def create_sms_code():
1345
    return ''.join(
1346
        random.choices(
1347
            settings.SMS_CODE_ALLOWED_CHARACTERS,
1348
            k=settings.SMS_CODE_LENGTH,
1349
        )
1350
    )
1351

  
1352

  
1344 1353
class PasswordChangeError(Exception):
1345 1354
    def __init__(self, message):
1346 1355
        self.message = message
1347
-