def get_enrolled_students(course_id):
 objects = UserProfile.objects
 course_key = CourseKey.from_string(course_id)
 students = objects.filter(user__courseenrollment__course_id=course_key, user__courseenrollment__is_active=True)
 return students

def get_enrolled_students ( course_id ) : objects = UserProfile . objects course_key = CourseKey . from_string ( course_id ) students = objects . filter ( user__courseenrollment__course_id = course_key , user__courseenrollment__is_active = True ) return students
given a course_id .