Commit fd54b060 by Julia Hansbrough Committed by Brian Wilson

added self to authors style, changed GET to POST

parent c7d4270a
......@@ -63,6 +63,20 @@ def add_to_course_staff(username, course_num):
user = User.objects.get(username=username)
user.groups.add(group)
@world.absorb
def add_to_course_staff(username, course_num):
"""
Add the user with `username` to the course staff group
for `course_num`.
"""
# Based on code in lms/djangoapps/courseware/access.py
group_name = "instructor_{}".format(course_num)
group, _ = Group.objects.get_or_create(name=group_name)
group.save()
user = User.objects.get(username=username)
user.groups.add(group)
@world.absorb
def clear_courses():
......
......@@ -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)
......
......@@ -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,
......
......@@ -265,10 +265,13 @@ section.instructor-dashboard-content-2 {
margin-bottom: 20px;
font-weight: 600;
color: green;
.copy {
font-weight: 600;
}
}
.msg-confirm {
border-top: 2px solid green;
background: tint(green,90%);
display: none;
}
......
......@@ -45,6 +45,5 @@
</ul>
</div>
<input type="button" name="send" value="${_("Send Email")}" data-endpoint="${ section_data['send_email'] }" >
<input type="button" name="send" value="${_("Send")}" data-endpoint="${ section_data['send_email'] }" >
<div class="request-response-error"></div>
</div>
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