From 1aca4485ad798cac55fa107b1cae68dfd716cefc Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Sat, 4 Feb 2017 20:23:58 +0100 Subject: Utilisation de la variable correcte dans le modèle des groupes --- models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models.py b/models.py index 536c3b8..85d340c 100644 --- a/models.py +++ b/models.py @@ -57,7 +57,7 @@ class Group(models.Model): def save(self): try: - parts = self.name.split("-")[-2:] + parts = self.celcat_name.split("-")[-2:] group = parts[1].strip()[2:] self.mention = parts[0].strip() @@ -68,9 +68,9 @@ class Group(models.Model): if len(group) > 2: self.tp = int(group[2]) except: - print("Malformed name: {0}. Ignoring".format(self.name)) + print("Malformed name: {0}. Ignoring".format(self.celcat_name)) finally: - if self.name is None: + if self.name == "": self.name = self.celcat_name self.slug = slugify(self.name) -- cgit v1.2.1