From 4991713023cf0856d1e688cbd534e5507595479f Mon Sep 17 00:00:00 2001 From: arielfayol37 Date: Tue, 21 Nov 2023 14:37:19 -0600 Subject: [PATCH] fixed bug in potential calculation:replaced assignment.due_date with assignment_student.due_date --- deimos/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deimos/models.py b/deimos/models.py index 53f51efd..dad192a9 100644 --- a/deimos/models.py +++ b/deimos/models.py @@ -298,7 +298,8 @@ def get_potential(self, no_unit = False): If no_unit, then we don't add the units points in the potential """ try: - days_overdue = max(0, (date.today() - self.question.assignment.due_date.date()).days) + assignment_student = AssignmentStudent.objects.get(assignment=self.question.assignment, student=self.student) + days_overdue = max(0, (date.today() - assignment_student.due_date.date()).days) overall_percentage = max(self.question.assignment.grading_scheme.floor_percentage, \ 1 - days_overdue * self.question.assignment.grading_scheme.late_sub_deduct) except: