sonar issues

This commit is contained in:
jain
2023-07-14 12:05:28 +05:30
parent 5d528b885a
commit 7b9b5a2c6f
11 changed files with 77 additions and 48 deletions

View File

@ -183,13 +183,15 @@ def get_token(data: dict = dict):
def generate_alphanumeric_code(length):
"""Generate alphanumeric code"""
alphabet = string.ascii_letters + string.digits
code = ''.join(secrets.choice(alphabet) for _ in range(length))
return code
def generate_code(value, user_id):
alphabet = value + user_id.zfill(3)
return alphabet
"""generate referral, junior and guardian code"""
code = value + str(user_id).zfill(3)
return code