From 3632618c1d52e73980e7e481e997c3eca7845d7f Mon Sep 17 00:00:00 2001 From: prathamesh Date: Thu, 31 Mar 2016 13:41:43 +0530 Subject: Django 1.5.7 does not support first() So had to make changes. --- yaksh/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'yaksh/models.py') diff --git a/yaksh/models.py b/yaksh/models.py index 828b0a0..bb8d193 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -529,7 +529,8 @@ class AnswerPaper(models.Model): def current_question(self): """Returns the current active question to display.""" - return self.questions_unanswered.first() + if self.questions_unanswered.all(): + return self.questions_unanswered.all()[0] def questions_left(self): """Returns the number of questions left.""" -- cgit