summaryrefslogtreecommitdiff
path: root/yaksh/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh/models.py')
-rw-r--r--yaksh/models.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/yaksh/models.py b/yaksh/models.py
index 6db1298..bb85085 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -24,13 +24,11 @@ class Profile(models.Model):
position = models.CharField(max_length=64)
def is_moderator(self, user):
- return True if user.groups.filter(name='moderator').exists() else False
+ return user.groups.filter(name='moderator').exists()
def _add_to_group(self, user):
group = Group.objects.get(name="moderator")
user.groups.add(group)
- user.profile.position = "Faculty"
- user.profile.save()
languages = (
("python", "Python"),
@@ -139,6 +137,12 @@ class Course(models.Model):
rejected_teachers.append(teacher)
return added_teachers, rejected_teachers
+ def get_teachers(self):
+ return self.teachers.all()
+
+ def remove_teachers(self, *teachers):
+ self.teachers.remove(*teachers)
+
def __unicode__(self):
return self.name