mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-26 16:44:54 +00:00
make special password method modified
This commit is contained in:
@ -300,24 +300,21 @@ def make_special_password(length=10):
|
|||||||
lowercase_letters = string.ascii_lowercase
|
lowercase_letters = string.ascii_lowercase
|
||||||
uppercase_letters = string.ascii_uppercase
|
uppercase_letters = string.ascii_uppercase
|
||||||
digits = string.digits
|
digits = string.digits
|
||||||
special_characters = '!@#$%^&*()_-+=<>?/[]{}|'
|
special_characters = '@#$%&*?'
|
||||||
|
|
||||||
# Combine character sets
|
# Combine character sets
|
||||||
alphabets = lowercase_letters + uppercase_letters
|
alphabets = lowercase_letters + uppercase_letters
|
||||||
|
|
||||||
# Create a password with random characters
|
# Create a password with random characters
|
||||||
password = (
|
password = [
|
||||||
secrets.choice(lowercase_letters) +
|
|
||||||
secrets.choice(uppercase_letters) +
|
secrets.choice(uppercase_letters) +
|
||||||
|
secrets.choice(lowercase_letters) +
|
||||||
secrets.choice(digits) +
|
secrets.choice(digits) +
|
||||||
secrets.choice(special_characters) +
|
secrets.choice(special_characters) +
|
||||||
''.join(secrets.choice(alphabets) for _ in range(length - 4))
|
''.join(secrets.choice(alphabets) for _ in range(length - 4))
|
||||||
)
|
]
|
||||||
|
|
||||||
# Shuffle the characters to make it more random
|
return ''.join(password)
|
||||||
password_list = list(password)
|
|
||||||
random.shuffle(password_list)
|
|
||||||
return ''.join(password_list)
|
|
||||||
|
|
||||||
def task_status_fun(status_value):
|
def task_status_fun(status_value):
|
||||||
"""task status"""
|
"""task status"""
|
||||||
|
|||||||
Reference in New Issue
Block a user