diff --git a/course/tests.py b/course/tests.py index 440e0553d..f0290cf45 100644 --- a/course/tests.py +++ b/course/tests.py @@ -413,7 +413,7 @@ def test_student_enroll_from_sis(self): # Sisu import should not remove manually enrolled students self.past_course_instance.enroll_student(self.user1) self.assertTrue(self.past_course_instance.is_student(self.user1)) - response = self.client.post( # pylint: disable=unused-variable + response = self.client.post( reverse("enroll-students", kwargs={ 'course_slug': self.course.url, 'instance_slug': self.past_course_instance.url, @@ -427,7 +427,7 @@ def test_student_enroll_from_sis(self): self.past_course_instance.enroll_student(self.user2, from_sis=True) self.assertTrue(self.past_course_instance.is_student(self.user1)) self.assertTrue(self.past_course_instance.is_student(self.user2)) - response = self.client.post( # pylint: disable=unused-variable + response = self.client.post( reverse("enroll-students", kwargs={ 'course_slug': self.course.url, 'instance_slug': self.past_course_instance.url, diff --git a/exercise/templatetags/exercise.py b/exercise/templatetags/exercise.py index 10c572180..4a2c781e7 100644 --- a/exercise/templatetags/exercise.py +++ b/exercise/templatetags/exercise.py @@ -80,7 +80,12 @@ def check_exercise_deadline_extensions(children, entry_name, is_module_specific= exercise_count = 0 for exercise in children: # Module specific ToC page - if is_module_specific and exercise.parent and exercise.parent.name == entry_name and exercise.personal_deadline: + if ( + is_module_specific + and exercise.parent + and exercise.parent.name == entry_name + and exercise.personal_deadline + ): exercise_count += 1 # ToC page elif exercise.type != 'level' and not exercise.is_empty and exercise.submittable: