Commit e9771b12 authored by Chris Reffett's avatar Chris Reffett

Add sanitizer for courses

parent 0103c4f6
......@@ -10,6 +10,19 @@ def programCourses(program):
for course in requirement.courses.all():
courses.append(course)
repeat = True
while repeat:
repeat = False
for course in courses:
try:
course = Course.objects.get(title=course.title)
except:
coursegroup = CourseGroup.objects.get(title=course.title)
repeat = True
courses.remove(course)
for newcourse in coursegroup.courses:
courses.append(newcourse)
return courses
def genDepTree(course):
......
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