aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-03-26 14:25:16 +0200
committerAlban Gruin2017-03-26 14:25:16 +0200
commit10e90edecc88cb45ac7c88c9ec77de00d656d470 (patch)
treec18e4d5e565f3173f879d2484d3e0ab130264ee1 /models.py
parentce0ed9347adde9ca80c11efe79766c966d5749ba (diff)
parentb0154d43011825731b0e4ff7c4f44b7f5770b3c2 (diff)
Merge branch 'stable/0.7.z' into prod/pa1ch/0.7.zv0.7.1-pa1ch
Diffstat (limited to 'models.py')
-rw-r--r--models.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/models.py b/models.py
index 478b48f..32a5903 100644
--- a/models.py
+++ b/models.py
@@ -66,14 +66,14 @@ class Group(models.Model):
timetable = models.ForeignKey(Timetable, on_delete=models.CASCADE, verbose_name="emploi du temps")
mention = models.CharField(max_length=32)
- subgroup = models.CharField(max_length=1, verbose_name="sous-groupe")
+ subgroup = models.CharField(max_length=1, verbose_name="sous-groupe", null=True)
td = models.IntegerField(verbose_name="groupe de TD", null=True)
tp = models.IntegerField(verbose_name="groupe de TP", null=True)
slug = models.SlugField(max_length=64, default="")
def corresponds_to(self, timetable_id, mention, subgroup, td, tp):
- return self.timetable.id == timetable_id and self.mention == mention and self.subgroup == subgroup and (self.td == td or self.td is None or td is None) and (self.tp == tp or self.tp is None or tp is None)
+ return self.timetable.id == timetable_id and self.mention.startswith(mention) and (self.subgroup == subgroup or self.subgroup is None) and (self.td == td or self.td is None or td is None) and (self.tp == tp or self.tp is None or tp is None)
@property
def group_info(self):