|
|
@ -13,7 +13,7 @@ from django.utils.encoding import force_text |
|
|
|
from django.utils.text import slugify |
|
|
|
from django.urls import reverse |
|
|
|
from django.core.cache import cache |
|
|
|
from django.core.exceptions import ObjectDoesNotExist |
|
|
|
from django.core.exceptions import ObjectDoesNotExist, ValidationError |
|
|
|
from django.contrib.contenttypes.models import ContentType |
|
|
|
from django.utils.text import get_valid_filename |
|
|
|
from imagekit.models import ImageSpecField, ProcessedImageField |
|
|
@ -581,6 +581,11 @@ class Organizator(SeminarModelBase): |
|
|
|
help_text="Škola, např. MFF, VŠCHT, VUT, ... prostě aby se nemuselo psát do studuje" |
|
|
|
"školu, ale jen obor, možnost zobrazit zvlášť") |
|
|
|
|
|
|
|
def clean(self): |
|
|
|
if self.organizuje_od > self.organizuje_do: |
|
|
|
raise ValidationError("Organizátor nemůže skončit s organizováním dříve než začal!") |
|
|
|
super().clean() |
|
|
|
|
|
|
|
def __str__(self): |
|
|
|
if self.osoba.prezdivka: |
|
|
|
return "{} '{}' {}".format(self.osoba.jmeno, |
|
|
|