From c6475d2dc6c08fbaac3a0803f2b88c1aed539ff1 Mon Sep 17 00:00:00 2001 From: ankitjavalkar Date: Mon, 4 Mar 2019 20:21:16 +0530 Subject: Fix PEP8 issues --- yaksh/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/yaksh/models.py b/yaksh/models.py index 7a4d8d1..c4e5a50 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -1600,7 +1600,9 @@ class QuestionPaper(models.Model): attempts = AnswerPaper.objects.get_total_attempt(questionpaper=self, user=user, course_id=course_id) - return attempts < self.quiz.attempts_allowed or self.quiz.attempts_allowed == -1 + attempts_allowed = attempts < self.quiz.attempts_allowed + infinite_attempts = self.quiz.attempts_allowed == -1 + return attempts_allowed or infinite_attempts def can_attempt_now(self, user, course_id): if self._is_attempt_allowed(user, course_id): -- cgit