mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 13:49:40 +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
|
||||
uppercase_letters = string.ascii_uppercase
|
||||
digits = string.digits
|
||||
special_characters = '!@#$%^&*()_-+=<>?/[]{}|'
|
||||
special_characters = '@#$%&*?'
|
||||
|
||||
# Combine character sets
|
||||
alphabets = lowercase_letters + uppercase_letters
|
||||
|
||||
# Create a password with random characters
|
||||
password = (
|
||||
secrets.choice(lowercase_letters) +
|
||||
password = [
|
||||
secrets.choice(uppercase_letters) +
|
||||
secrets.choice(lowercase_letters) +
|
||||
secrets.choice(digits) +
|
||||
secrets.choice(special_characters) +
|
||||
''.join(secrets.choice(alphabets) for _ in range(length - 4))
|
||||
)
|
||||
]
|
||||
|
||||
# Shuffle the characters to make it more random
|
||||
password_list = list(password)
|
||||
random.shuffle(password_list)
|
||||
return ''.join(password_list)
|
||||
return ''.join(password)
|
||||
|
||||
def task_status_fun(status_value):
|
||||
"""task status"""
|
||||
|
Reference in New Issue
Block a user