Commit 875deed5 by Rabia Iftikhar Committed by GitHub

Merge pull request #15092 from edx/ri/EDUCATOR-217-364-add-logs-bulk-email

EDUCATOR-217-364 add logs in bulk email
parents 8540e8f4 ffa9b7ef
......@@ -2523,6 +2523,7 @@ def send_email(request, course_id):
course_id = CourseKey.from_string(course_id)
if not BulkEmailFlag.feature_enabled(course_id):
log.warning(u'Email is not enabled for course %s', course_id)
return HttpResponseForbidden("Email is not enabled for this course.")
targets = json.loads(request.POST.get("send_to"))
......@@ -2564,6 +2565,8 @@ def send_email(request, course_id):
from_addr=from_addr
)
except ValueError as err:
log.exception(u'Cannot create course email for course %s requested by user %s for targets %s',
course_id, request.user, targets)
return HttpResponseBadRequest(repr(err))
# Submit the task, so that the correct InstructorTask object gets created (for monitoring purposes)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment