Speed up create import pins script.

This commit is contained in:
PhilipWafula 2021-06-09 14:58:41 +03:00
parent 0520a84b9e
commit 03215ded11
Signed by untrusted user: mango-habanero
GPG Key ID: B00CE9034DA19FB7

View File

@ -3,6 +3,7 @@ import argparse
import json import json
import logging import logging
import os import os
import uuid
# third-party imports # third-party imports
import bcrypt import bcrypt
@ -83,7 +84,7 @@ if __name__ == '__main__':
phone_object = phonenumbers.parse(u.tel) phone_object = phonenumbers.parse(u.tel)
phone = phonenumbers.format_number(phone_object, phonenumbers.PhoneNumberFormat.E164) phone = phonenumbers.format_number(phone_object, phonenumbers.PhoneNumberFormat.E164)
password_hash = generate_password_hash() password_hash = uuid.uuid4().hex
pins_file.write(f'{phone},{password_hash}\n') pins_file.write(f'{phone},{password_hash}\n')
logg.info(f'Writing phone: {phone}, password_hash: {password_hash}') logg.info(f'Writing phone: {phone}, password_hash: {password_hash}')