aboutsummaryrefslogtreecommitdiff
path: root/models.py
diff options
context:
space:
mode:
authorAlban Gruin2017-03-26 14:23:44 +0200
committerAlban Gruin2017-03-26 14:23:44 +0200
commitb0154d43011825731b0e4ff7c4f44b7f5770b3c2 (patch)
tree12f7bc2e960098c081aee8fa90a4dd38937605a8 /models.py
parent66be6f2e7a3c642fb3c69e7c2a70cc3f898d77ea (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.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):