From 9c3e0a8e831a1e5f83f50e2c56228d2d65e5e7f6 Mon Sep 17 00:00:00 2001 From: Bryan Date: Mon, 30 Mar 2015 13:54:04 -0400 Subject: [PATCH] remove duplicate courses to scoreboard counts closes #421 --- karmaworld/apps/courses/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/karmaworld/apps/courses/models.py b/karmaworld/apps/courses/models.py index 13b39d7..0746f64 100644 --- a/karmaworld/apps/courses/models.py +++ b/karmaworld/apps/courses/models.py @@ -93,11 +93,11 @@ class School(models.Model): contained course.file_count """ # find all courses without a department - course_list = list(self.course_set.all()) + course_list = set(self.course_set.all()) # find all courses with a department for department in self.department_set.all(): for course in department.course_set.all(): - course_list.append(course) + course_list.add(course) self.file_count = sum([course.file_count for course in course_list]) self.save() -- 2.25.1