Use sha512_crypt from passlib.handlers.sha2_crypt
This commit is contained in:
parent
610f8976fc
commit
a8392ef91e
3 changed files with 4 additions and 12 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue