diff options
author | Alban Gruin | 2017-03-26 14:23:44 +0200 |
---|---|---|
committer | Alban Gruin | 2017-03-26 14:23:44 +0200 |
commit | b0154d43011825731b0e4ff7c4f44b7f5770b3c2 (patch) | |
tree | 12f7bc2e960098c081aee8fa90a4dd38937605a8 /models.py | |
parent | 66be6f2e7a3c642fb3c69e7c2a70cc3f898d77ea (diff) |
Modification de la regex de validation de groupe pour gérer globalement les licences entièresv0.7.1
Modification de la méthode de correspondance des groupes
Diffstat (limited to 'models.py')
-rw-r--r-- | models.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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): |