|
|
@ -793,11 +793,14 @@ class Organizator(models.Model): |
|
|
|
verbose_name_plural = 'Organizátoři' |
|
|
|
|
|
|
|
def save(self): |
|
|
|
if self.id is not None: |
|
|
|
puvodni = Organizator.objects.get(id=self.id) |
|
|
|
if self.foto: |
|
|
|
original = Image.open(self.foto) |
|
|
|
jmeno = os.path.basename(self.foto.file.name) |
|
|
|
Organizator._vyrobMiniaturu(original, jmeno, 500, self.foto) |
|
|
|
Organizator._vyrobMiniaturu(original, jmeno, 200, self.foto_male) |
|
|
|
if not puvodni or puvodni.foto != self.foto: |
|
|
|
original = Image.open(self.foto) |
|
|
|
jmeno = os.path.basename(self.foto.file.name) |
|
|
|
Organizator._vyrobMiniaturu(original, jmeno, 500, self.foto) |
|
|
|
Organizator._vyrobMiniaturu(original, jmeno, 200, self.foto_male) |
|
|
|
super(Organizator, self).save() |
|
|
|
|
|
|
|
@staticmethod |
|
|
|