aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'models.py')
-rw-r--r--models.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/models.py b/models.py
index abb00bf..fb0e757 100644
--- a/models.py
+++ b/models.py
@@ -101,7 +101,7 @@ class Group(models.Model):
hidden = models.BooleanField(verbose_name="caché", default=False)
- def corresponds_to(self, mention, subgroup):
+ def corresponds_to(self, mention, semester, subgroup):
subgroup_corresponds = True
if self.subgroup is not None and subgroup is not None:
subgroup_corresponds = self.subgroup.startswith(subgroup)
@@ -109,11 +109,12 @@ class Group(models.Model):
# TODO adapter pour semester
return (self.mention.startswith(mention) or \
mention.startswith(self.mention)) and \
+ (self.semester == semester or semester is None) and \
subgroup_corresponds
@property
def group_info(self):
- return self.mention, self.subgroup
+ return self.mention, self.semester, self.subgroup
def __str__(self):
return self.name