ep api class

This commit is contained in:
2020-09-06 08:32:28 +00:00
parent 36761ac4d5
commit 7114126ba5
7 changed files with 74 additions and 49 deletions

View File

@@ -9,7 +9,7 @@ from django.utils.translation import gettext_lazy as _
from members.models import Member
from taggit.managers import TaggableManager
# import documents
from documents import ep
# from ckeditor_uploader import RichTextUploadingField
# import uuid
@@ -200,7 +200,9 @@ 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):
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)
print("should create an agenda document")
if self.has_protocol and (self.agenda_key == "" or self.agenda_key is None):
@@ -297,8 +299,9 @@ class FetMeeting(Event):
slug = slugify(self.event_start.date()) + "-" + slugify("Fachschaftssitzung")
if Post.objects.filter(slug=slug).count() != 0:
raise ValidationError(_('Es existiert bereits eine Sitzung mit demselben Datum.'))
#dieser Check verhindert erneutes speichern
#if Post.objects.filter(slug=slug).count() != 0:
# raise ValidationError(_('Es existiert bereits eine Sitzung mit demselben Datum.'))
def save(self, *args, **kwargs):
self.title = "Fachschaftssitzung"