This commit is contained in:
j 2021-11-19 15:41:08 +01:00
parent 97a9c7951a
commit 62b9e18ffd

View file

@ -38,7 +38,7 @@ class Event(models.Model):
else:
url = self.media
if 'youtube.com/watch' in url:
url = url.replace('/watch?=v', '/embed/')
url = url.replace('/watch?v=', '/embed/')
html += '<iframe src="%s" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>' % url
if self.media_caption:
html = '<figure>%s<figcaption>%s</figcaption></figure>' % (html, self.media_caption)