diff options
author | prathamesh | 2016-03-31 13:41:43 +0530 |
---|---|---|
committer | prathamesh | 2016-04-01 17:04:56 +0530 |
commit | 3632618c1d52e73980e7e481e997c3eca7845d7f (patch) | |
tree | 0e0721af3fafe17b0b336680349b66c586f6308d /yaksh/models.py | |
parent | b121d2215b7cd5f4de9d78a0bee015952d3f5d97 (diff) | |
download | online_test-3632618c1d52e73980e7e481e997c3eca7845d7f.tar.gz online_test-3632618c1d52e73980e7e481e997c3eca7845d7f.tar.bz2 online_test-3632618c1d52e73980e7e481e997c3eca7845d7f.zip |
Django 1.5.7 does not support first()
So had to make changes.
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 3 |
1 files changed, 2 insertions, 1 deletions
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.""" |