resolve merge conflicts
test fixes
This commit is contained in:
@@ -2643,51 +2643,6 @@ def enable_certificate_generation(request, course_id=None):
|
||||
return redirect(_instructor_dash_url(course_key, section='certificates'))
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
#---- Gradebook (shown to small courses only) ----
|
||||
# Grades can potentially be written - if so, let grading manage the transaction.
|
||||
@transaction.non_atomic_requests
|
||||
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
|
||||
@require_level('staff')
|
||||
def spoc_gradebook(request, course_id):
|
||||
"""
|
||||
Show the gradebook for this course:
|
||||
- Only shown for courses with enrollment < settings.FEATURES.get("MAX_ENROLLMENT_INSTR_BUTTONS")
|
||||
- Only displayed to course staff
|
||||
"""
|
||||
course_key = SlashSeparatedCourseKey.from_deprecated_string(course_id)
|
||||
course = get_course_with_access(request.user, 'staff', course_key, depth=None)
|
||||
|
||||
enrolled_students = User.objects.filter(
|
||||
courseenrollment__course_id=course_key,
|
||||
courseenrollment__is_active=1
|
||||
).order_by('username').select_related("profile")
|
||||
|
||||
# possible extension: implement pagination to show to large courses
|
||||
|
||||
student_info = [
|
||||
{
|
||||
'username': student.username,
|
||||
'id': student.id,
|
||||
'email': student.email,
|
||||
'grade_summary': student_grades(student, request, course),
|
||||
'realname': student.profile.name,
|
||||
}
|
||||
for student in enrolled_students
|
||||
]
|
||||
|
||||
return render_to_response('courseware/gradebook.html', {
|
||||
'students': student_info,
|
||||
'course': course,
|
||||
'course_id': course_key,
|
||||
# Checked above
|
||||
'staff_access': True,
|
||||
'ordered_grades': sorted(course.grade_cutoffs.items(), key=lambda i: i[1], reverse=True),
|
||||
})
|
||||
|
||||
|
||||
>>>>>>> origin/release
|
||||
@ensure_csrf_cookie
|
||||
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
|
||||
@require_level('staff')
|
||||
@@ -2770,6 +2725,7 @@ def start_certificate_regeneration(request, course_id):
|
||||
return JsonResponse(response_payload)
|
||||
|
||||
|
||||
@transaction.non_atomic_requests
|
||||
@ensure_csrf_cookie
|
||||
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
|
||||
@require_global_staff
|
||||
|
||||
@@ -6,6 +6,7 @@ import math
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.db import transaction
|
||||
from django.views.decorators.cache import cache_control
|
||||
|
||||
from opaque_keys.edx.keys import CourseKey
|
||||
@@ -96,6 +97,7 @@ def get_grade_book_page(request, course, course_key):
|
||||
return student_info, page
|
||||
|
||||
|
||||
@transaction.non_atomic_requests
|
||||
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
|
||||
@require_level('staff')
|
||||
def spoc_gradebook(request, course_id):
|
||||
|
||||
@@ -129,11 +129,7 @@ class TestDashboard(SharedModuleStoreTestCase):
|
||||
team.add_user(self.user)
|
||||
|
||||
# Check the query count on the dashboard again
|
||||
<<<<<<< HEAD
|
||||
with self.assertNumQueries(19):
|
||||
=======
|
||||
with self.assertNumQueries(24):
|
||||
>>>>>>> origin/release
|
||||
with self.assertNumQueries(23):
|
||||
self.client.get(self.teams_url)
|
||||
|
||||
def test_bad_course_id(self):
|
||||
|
||||
Reference in New Issue
Block a user