summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
authorprathamesh2016-03-07 16:29:47 +0530
committerprathamesh2016-03-07 16:29:47 +0530
commite94f589eea5fbe85253d35f836d308bbfd339ff0 (patch)
treefed6bee014f126eb5c435e2ed53235a2ba9e224d /yaksh/models.py
parentb58a0b9831d8e6434362f776c89076c2d84e9b26 (diff)
downloadonline_test-e94f589eea5fbe85253d35f836d308bbfd339ff0.tar.gz
online_test-e94f589eea5fbe85253d35f836d308bbfd339ff0.tar.bz2
online_test-e94f589eea5fbe85253d35f836d308bbfd339ff0.zip
Added a checkpoint, quizzes will be available only if the user is
enrolled for the respective course.
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 46fb9a3..1bbd035 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -98,8 +98,8 @@ class Course(models.Model):
def get_rejected(self):
return self.rejected.all()
- def is_enrolled(self, user_id):
- return self.students.filter(id=user_id).exists()
+ def is_enrolled(self, user):
+ return user in self.students.all()
def is_creator(self, user):
return self.creator == user