make special password method modified

This commit is contained in:
abutalib-kiwi
2023-09-11 17:01:03 +05:30
parent c800853e9b
commit ca0041caa6

View File

@ -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"""