mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-06-05 16:56:19 +00:00
Fix user verification logging to handle None values for atoll and island attributes
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 3m15s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 3m15s
This commit is contained in:
parent
907b713082
commit
a05852f3f6
14
api/tasks.py
14
api/tasks.py
@ -165,7 +165,7 @@ def verify_user_with_person_api_task(user_id: int):
|
||||
*Name:* {user.first_name} {user.last_name} \n
|
||||
*House Name:* {user.address} \n
|
||||
*Date of Birth:* {user.dob} \n
|
||||
*Island:* {user.atoll} {user.island} \n
|
||||
*Island:* {(user.atoll.name if user.atoll else "N/A")} {(user.island.name if user.island else "N/A")} \n
|
||||
*Mobile:* {user.mobile} \n
|
||||
|
||||
Visit [SAR Link Portal](https://portal.sarlink.net) to manually verify this user.
|
||||
@ -211,10 +211,14 @@ def verify_user_with_person_api_task(user_id: int):
|
||||
logger.info(f"User atoll: {user.atoll}")
|
||||
logger.info(f"User island name: {user.island}")
|
||||
|
||||
logger.info(f"case User atoll: {user.atoll == api_atoll}")
|
||||
logger.info("api atoll type: ", {type(api_atoll)})
|
||||
logger.info("user atoll type: ", {type(user.atoll.name)})
|
||||
logger.info(f"case User island name: {user.island == api_island_name}")
|
||||
logger.info(
|
||||
f"case User atoll: {user.atoll.name == api_atoll.strip() if api_atoll else False}"
|
||||
) # Defensive check for api_atoll
|
||||
logger.info(f"api atoll type: {type(api_atoll)}")
|
||||
logger.info(f"user atoll type: {type(user.atoll.name)}")
|
||||
logger.info(
|
||||
f"case User island name: {user.island.name == api_island_name.strip() if api_island_name else False}"
|
||||
) # Defensive check for api_island_name
|
||||
logger.info(f"api island name type: {type(api_island_name)}")
|
||||
logger.info(f"user island name type: {type(user.island.name)}")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user