Use sha512_crypt from passlib.handlers.sha2_crypt

This commit is contained in:
Jan Dittberner 2023-02-19 13:47:08 +01:00
parent 610f8976fc
commit a8392ef91e
3 changed files with 4 additions and 12 deletions

View file

@ -14,7 +14,7 @@ from django.dispatch import Signal
from django.utils import timezone
from django.utils.translation import gettext as _
from model_utils.models import TimeStampedModel
from passlib.hash import sha512_crypt
from passlib.handlers.sha2_crypt import sha512_crypt
from passlib.pwd import genword
_LOGGER = logging.getLogger(__name__)
@ -175,8 +175,7 @@ class UserManager(models.Manager):
shell=settings.OSUSER_DEFAULT_SHELL,
)
user.set_password(password)
if commit:
user.save()
user.save()
return user