summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
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