misc: use set_random_password() in csv_import (#47943)

This commit is contained in:
Benjamin Dauvergne 2020-11-05 18:43:22 +01:00
parent 4a2305459f
commit 9fe6ce378f
1 changed files with 2 additions and 2 deletions

View File

@ -39,7 +39,7 @@ from authentic2.a2_rbac.utils import get_default_ou
from authentic2.custom_user.models import User
from authentic2.forms.profile import modelform_factory, BaseUserForm
from authentic2.models import Attribute, AttributeValue, UserExternalId
from authentic2.utils import send_password_reset_mail, generate_password
from authentic2.utils import send_password_reset_mail
Role = get_role_model()
@ -673,7 +673,7 @@ class UserCsvImporter(object):
if not user:
user = User(ou=self.ou)
user.set_password(generate_password())
user.set_random_password()
for cell in row.cells:
if not cell.header.field: