mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2026-02-05 13:15:17 -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:
@@ -26,6 +26,7 @@ from django.utils.crypto import get_random_string
|
||||
from django_forwardemail.services import EmailService
|
||||
|
||||
from .models import EmailVerification, User, UserDeletionRequest, UserProfile
|
||||
from apps.core.utils import capture_and_log
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -130,7 +131,7 @@ class AccountService:
|
||||
html=email_html,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send password change confirmation email: {e}")
|
||||
capture_and_log(e, 'Send password change confirmation email', source='service', severity='medium')
|
||||
|
||||
@staticmethod
|
||||
def initiate_email_change(
|
||||
@@ -206,7 +207,7 @@ class AccountService:
|
||||
html=email_html,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to send email verification: {e}")
|
||||
capture_and_log(e, 'Send email verification', source='service', severity='medium')
|
||||
|
||||
@staticmethod
|
||||
def verify_email_change(*, token: str) -> dict[str, Any]:
|
||||
|
||||
Reference in New Issue
Block a user