mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-02-05 13:35:19 -05:00
refactor: Replace direct logger.error calls with capture_and_log in accounts services and conditionally pass error_id during ApplicationError creation.
This commit is contained in:
@@ -17,6 +17,7 @@ from django.utils import timezone
|
||||
from django_forwardemail.services import EmailService
|
||||
|
||||
from apps.accounts.models import NotificationPreference, User, UserNotification
|
||||
from apps.core.utils import capture_and_log
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -264,7 +265,7 @@ class NotificationService:
|
||||
logger.info(f"Email notification sent to {user.email} for notification {notification.id}")
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send email notification {notification.id}: {str(e)}")
|
||||
capture_and_log(e, f'Send email notification {notification.id}', source='service')
|
||||
|
||||
@staticmethod
|
||||
def get_user_notifications(
|
||||
|
||||
Reference in New Issue
Block a user