From e503ef3d03af73540652b4d84c2ae495cc172210 Mon Sep 17 00:00:00 2001 From: Awais Jibran Date: Tue, 30 Aug 2016 18:32:25 +0500 Subject: [PATCH] Improve logging for email sending while registering. --- common/djangoapps/student/views.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index b9bb7ddfd7..46e54b2bfa 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -1775,6 +1775,7 @@ def create_account_with_params(request, params): ) ) if send_email: + dest_addr = user.email context = { 'name': profile.name, 'key': registration.activation_key, @@ -1799,7 +1800,12 @@ def create_account_with_params(request, params): else: user.email_user(subject, message, from_address) except Exception: # pylint: disable=broad-except - log.error(u'Unable to send activation email to user from "%s"', from_address, exc_info=True) + log.error( + u'Unable to send activation email to user from "%s" to "%s"', + from_address, + dest_addr, + exc_info=True + ) else: registration.activate() _enroll_user_in_pending_courses(user) # Enroll student in any pending courses