mirror of
https://github.com/i701/sarlink-portal-api.git
synced 2025-06-27 22:03:58 +00:00
Refactor device management: add vendor field, enhance admin display, and improve MAC address handling
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m18s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 4m18s
This commit is contained in:
18
api/tasks.py
18
api/tasks.py
@ -8,7 +8,7 @@ import os
|
||||
import logging
|
||||
from celery import shared_task
|
||||
from django.utils import timezone
|
||||
from api.notifications import send_telegram_markdown
|
||||
from api.notifications import send_clean_telegram_markdown
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@ -161,15 +161,15 @@ def verify_user_with_person_api_task(user_id: int):
|
||||
|
||||
verification_failed_message = f"""
|
||||
_The following user verification failed_:
|
||||
*ID Card:* {user.id_card} \n
|
||||
*Name:* {user.first_name} {user.last_name} \n
|
||||
*House Name:* {user.address} \n
|
||||
*Date of Birth:* {user.dob} \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
|
||||
|
||||
*ID Card:* {user.id_card}
|
||||
*Name:* {user.first_name} {user.last_name}
|
||||
*House Name:* {user.address}
|
||||
*Date of Birth:* {user.dob}
|
||||
*Island:* {(user.atoll.name if user.atoll else "N/A")} {(user.island.name if user.island else "N/A")}
|
||||
*Mobile:* {user.mobile}
|
||||
Visit [SAR Link Portal](https://portal.sarlink.net) to manually verify this user.
|
||||
"""
|
||||
|
||||
logger.info(verification_failed_message)
|
||||
if not PERSON_VERIFY_BASE_URL:
|
||||
raise ValueError(
|
||||
@ -245,7 +245,7 @@ def verify_user_with_person_api_task(user_id: int):
|
||||
user.mobile,
|
||||
f"Dear {user.first_name} {user.last_name}, \n\nYour account registration is being processed. \n\nWe will notify you once verification is complete. \n\n - SAR Link",
|
||||
)
|
||||
send_telegram_markdown(message=verification_failed_message)
|
||||
send_clean_telegram_markdown(message=verification_failed_message)
|
||||
return False
|
||||
else:
|
||||
# Handle the error case
|
||||
|
Reference in New Issue
Block a user