diff options
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |