Commit a0504aaa by Clinton Blackburn

Removed duplicate staff and subject UUIDs from programs index

LEARNER-2229
parent b10c85ec
......@@ -253,10 +253,10 @@ class ProgramIndex(BaseIndex, indexes.Indexable, OrganizationsMixin):
return self.prepare_authoring_organizations(obj) + self.prepare_credit_backing_organizations(obj)
def prepare_subject_uuids(self, obj):
return [str(subject.uuid) for course in obj.courses.all() for subject in course.subjects.all()]
return set([str(subject.uuid) for course in obj.courses.all() for subject in course.subjects.all()])
def prepare_staff_uuids(self, obj):
return [str(staff.uuid) for course_run in obj.course_runs for staff in course_run.staff.all()]
return set([str(staff.uuid) for course_run in obj.course_runs for staff in course_run.staff.all()])
def prepare_credit_backing_organizations(self, obj):
return self._prepare_organizations(obj.credit_backing_organizations.all())
......
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