render media

This commit is contained in:
j 2021-11-19 15:32:23 +01:00
parent 8a8abd33ff
commit 14679dc0a5

View file

@ -34,6 +34,8 @@ class Event(models.Model):
html = '' html = ''
if self.media and self.media.split('.')[-1] in ('jpg', 'png', 'gif'): if self.media and self.media.split('.')[-1] in ('jpg', 'png', 'gif'):
html += '<img src="%s">' % self.media html += '<img src="%s">' % self.media
elif '<' in self.media:
html = self.media
else: else:
html += '<iframe src="%s"></iframe>' % self.media html += '<iframe src="%s"></iframe>' % self.media
if self.media_caption: if self.media_caption: