This commit is contained in:
2020-09-08 05:21:36 +00:00
10 changed files with 91 additions and 56 deletions

View File

@@ -14,8 +14,6 @@ from .managers import (
PostManager, ArticleManager, NewsManager, AllEventManager, EventManager, FetMeetingManager
)
# from ckeditor_uploader import RichTextUploadingField
# import uuid
import re
@@ -149,9 +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")
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_protocol and (self.agenda_key == "" or self.agenda_key is None):
self.protocol_key = ep.createPadifNotExists(self.slug+"-protocol")
@@ -249,7 +249,6 @@ class FetMeeting(Event):
slug = slugify(self.event_start.date()) + "-" + slugify("Fachschaftssitzung")
if Post.objects.filter(slug=slug).exists():
if Post.objects.get(slug=slug).id != self.id:
raise ValidationError(_('Es existiert bereits eine Sitzung mit demselben Datum.'))