Fix obrazek_maly_tag kdyz neni zadny obrazek.

This commit is contained in:
Tomas "Jethro" Pokorny 2020-04-08 21:45:55 +02:00
parent d099f70985
commit 2fc738ae74

View file

@ -69,6 +69,8 @@ class Obrazek(models.Model):
ordering = ['nazev']
def obrazek_maly_tag(self):
if not self.obrazek_maly:
return ''
return u'<img src="{}">'.format(self.obrazek_maly.url)
obrazek_maly_tag.short_description = "Náhled"
obrazek_maly_tag.allow_tags = True