Working on user log in and person object
This commit is contained in:
@@ -54,10 +54,10 @@ def redis_lookup_id_random(record_id_random:int|str, table_name:str):
|
||||
log.setLevel(logging.WARNING) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
|
||||
log.debug(locals())
|
||||
|
||||
if isinstance(record_id_random, str): pass
|
||||
if isinstance(record_id_random, str) and len(record_id_random) >= 11 and len(record_id_random) <= 22: pass
|
||||
elif isinstance(record_id_random, int): return record_id_random
|
||||
else:
|
||||
log.warning(f'Unexpected data type: {str(type(record_id_random))} Expected type is a string 11 or 22 characters long.')
|
||||
log.warning(f'Unexpected data type or string format: {str(type(record_id_random))} Expected type is a string 11 or 22 characters long.')
|
||||
return False
|
||||
|
||||
if record_id_random and table_name:
|
||||
@@ -70,9 +70,15 @@ def redis_lookup_id_random(record_id_random:int|str, table_name:str):
|
||||
return False
|
||||
else:
|
||||
pass
|
||||
else:
|
||||
elif record_id_random:
|
||||
log.warning('Missing id_random')
|
||||
return False
|
||||
elif table_name:
|
||||
log.warning('Missing table_name to select from for id_random')
|
||||
return False
|
||||
else:
|
||||
log.warning('Missing table_name and record_id_random')
|
||||
return False
|
||||
|
||||
r = redis.Redis(host='localhost', port=6379, db=7, password=None, decode_responses=True)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user