API - allow admin to reset password for a given user
This commit is contained in:
12
fittrackee/users/utils/random.py
Normal file
12
fittrackee/users/utils/random.py
Normal file
@ -0,0 +1,12 @@
|
||||
import random
|
||||
import string
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def random_string(length: Optional[int] = None) -> str:
|
||||
if length is None:
|
||||
length = 10
|
||||
return ''.join(
|
||||
random.choice(string.ascii_letters + string.digits)
|
||||
for _ in range(length)
|
||||
)
|
Reference in New Issue
Block a user