restore password

This commit is contained in:
Diego Calvo
2021-03-31 10:14:36 +02:00
parent 373e892463
commit 7399b6a480
4 changed files with 725 additions and 0 deletions

View File

@@ -1,4 +1,6 @@
import logging
import random
import string
from io import BytesIO
from django.contrib.auth import get_user_model
@@ -199,3 +201,7 @@ def coop_loader(csv_reader, request=None):
logging.error(f"Could not parse {row}")
return coop_counter, user_counter
def generate_password(length):
result_str = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(length))
return result_str