fix: 修复 random error

This commit is contained in:
ibuler
2023-09-19 18:11:27 +08:00
parent f5c43488fd
commit 0eba6d2175
2 changed files with 2 additions and 4 deletions

View File

@@ -3,8 +3,6 @@
#
import base64
import datetime
import random
import string
import uuid
from typing import Callable
@@ -607,8 +605,7 @@ class TokenMixin:
return self.access_keys.first()
def generate_reset_token(self):
letter = string.ascii_letters + string.digits
token = ''.join([random.choice(letter) for _ in range(50)])
token = random_string(50)
self.set_cache(token)
return token