misc: decode bytes in User.set_random_password() (#49072)
This commit is contained in:
parent
be38c3ab23
commit
e8d20c6b36
|
@ -371,7 +371,7 @@ class User(AbstractBaseUser, PermissionMixin):
|
|||
self.save(update_fields=['is_active', 'deleted'])
|
||||
|
||||
def set_random_password(self):
|
||||
self.set_password(base64.b64encode(os.urandom(32)))
|
||||
self.set_password(base64.b64encode(os.urandom(32)).decode('ascii'))
|
||||
|
||||
|
||||
class DeletedUser(models.Model):
|
||||
|
|
Loading…
Reference in New Issue