diff options
author | Alban Gruin | 2017-02-04 20:23:58 +0100 |
---|---|---|
committer | Alban Gruin | 2017-02-04 20:23:58 +0100 |
commit | 1aca4485ad798cac55fa107b1cae68dfd716cefc (patch) | |
tree | f69d49f9af7a79277e63d562fe065abcd042640c | |
parent | 8861bddccf458846e12e679704a8514ec2dc2510 (diff) |
Utilisation de la variable correcte dans le modèle des groupes
-rw-r--r-- | models.py | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |