mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-17 02:45:08 +00:00
sonar issues
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user