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

This commit is contained in:
i701 2025-05-31 19:25:18 +05:00
parent 907b713082
commit a05852f3f6
Signed by: i701
GPG Key ID: 54A0DA1E26D8E587

View File

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