fix has_protocol condition

This commit is contained in:
2020-09-08 11:52:35 +00:00
parent bc65cfdcbc
commit 326f4670d0

View File

@@ -147,13 +147,11 @@ class Post(models.Model):
if (self.id is None) and (not self.slug): if (self.id is None) and (not self.slug):
self.slug = slugify(self.public_date.date()) + "-" + slugify(self.title) self.slug = slugify(self.public_date.date()) + "-" + slugify(self.title)
if self.has_agenda: # and (self.agenda_key == "" or self.agenda_key is None): if self.has_agenda:
self.agenda_key = ep.createPadifNotExists(self.slug + "agenda") self.agenda_key = ep.createPadifNotExists(self.slug + "-agenda")
print("AgendaKey: %s" % self.agenda_key)
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") self.protocol_key = ep.createPadifNotExists(self.slug + "-protocol")
print("should initialize protocol document")
super().save(*args, **kwargs) super().save(*args, **kwargs)