Commit fc46efb6 by Diana Huang

Fix bug in grabbing course enrollments.

LMS-1475
parent 2fed6181
...@@ -10,6 +10,7 @@ from capa.xqueue_interface import make_xheader, make_hashkey ...@@ -10,6 +10,7 @@ from capa.xqueue_interface import make_xheader, make_hashkey
from django.conf import settings from django.conf import settings
from requests.auth import HTTPBasicAuth from requests.auth import HTTPBasicAuth
from student.models import UserProfile, CourseEnrollment from student.models import UserProfile, CourseEnrollment
from verify_student.models import SoftwareSecurePhotoVerification
import json import json
import random import random
...@@ -174,7 +175,7 @@ class XQueueCertInterface(object): ...@@ -174,7 +175,7 @@ class XQueueCertInterface(object):
grade = grades.grade(student, self.request, course) grade = grades.grade(student, self.request, course)
is_whitelisted = self.whitelist.filter( is_whitelisted = self.whitelist.filter(
user=student, course_id=course_id, whitelist=True).exists() user=student, course_id=course_id, whitelist=True).exists()
enrollment = CourseEnrollment.objects.get(user=student) enrollment = CourseEnrollment.objects.get(user=student, course_id=course_id)
org = course_id.split('/')[0] org = course_id.split('/')[0]
course_num = course_id.split('/')[1] course_num = course_id.split('/')[1]
if enrollment.mode == CertificateModes.verified: if enrollment.mode == CertificateModes.verified:
......
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