added self to authors style, changed GET to POST

This commit is contained in:
Julia Hansbrough
2013-10-04 15:33:11 +00:00
committed by Brian Wilson
parent c7d4270ad4
commit fd54b060d8
5 changed files with 23 additions and 8 deletions

View File

@@ -54,7 +54,6 @@ class TestInstructorDashboardEmailView(ModuleStoreTestCase):
# Enabled and IS mongo
@patch.dict(settings.MITX_FEATURES, {'ENABLE_INSTRUCTOR_EMAIL': True})
def test_email_flag_true(self):
from nose.tools import set_trace; set_trace()
# Assert that the URL for the email view is in the response
response = self.client.get(self.url)
self.assertTrue(self.email_link in response.content)

View File

@@ -749,19 +749,19 @@ def list_forum_members(request, course_id):
@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_level('staff')
@require_query_params(send_to="sending to whom", subject="subject line", message="message text")
@require_post_params(send_to="sending to whom", subject="subject line", message="message text")
def send_email(request, course_id):
"""
Send an email to self, staff, or everyone involved in a course.
Query Paramaters:
Query Parameters:
- 'send_to' specifies what group the email should be sent to
- 'subject' specifies email's subject
- 'message' specifies email's content
"""
course = get_course_by_id(course_id)
send_to = request.GET.get("send_to")
subject = request.GET.get("subject")
message = request.GET.get("message")
send_to = request.POST.get("send_to")
subject = request.POST.get("subject")
message = request.POST.get("message")
text_message = html_to_text(message)
email = CourseEmail(
course_id=course_id,