From 326f4670d0bcb0b50b1ee802dd89ea0eaba76932 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 8 Sep 2020 11:52:35 +0000 Subject: [PATCH] fix has_protocol condition --- fet2020/posts/models.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fet2020/posts/models.py b/fet2020/posts/models.py index bfb477bf..bd168e43 100644 --- a/fet2020/posts/models.py +++ b/fet2020/posts/models.py @@ -147,13 +147,11 @@ class Post(models.Model): if (self.id is None) and (not self.slug): self.slug = slugify(self.public_date.date()) + "-" + slugify(self.title) - if self.has_agenda: # and (self.agenda_key == "" or self.agenda_key is None): - self.agenda_key = ep.createPadifNotExists(self.slug + "agenda") - print("AgendaKey: %s" % self.agenda_key) + if self.has_agenda: + self.agenda_key = ep.createPadifNotExists(self.slug + "-agenda") - if self.has_protocol and (self.agenda_key == "" or self.agenda_key is None): + if self.has_protocol: self.protocol_key = ep.createPadifNotExists(self.slug + "-protocol") - print("should initialize protocol document") super().save(*args, **kwargs)