misc: decode bytes in User.set_random_password() (#49072)

This commit is contained in:
Benjamin Dauvergne 2020-12-03 11:53:13 +01:00
parent be38c3ab23
commit e8d20c6b36
1 changed files with 1 additions and 1 deletions

View File

@ -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):