fix media

This commit is contained in:
j 2021-11-19 15:26:58 +01:00
parent a59093d7d2
commit c425753f11
2 changed files with 4 additions and 4 deletions

View file

@ -6,7 +6,7 @@ import ox
class Event(models.Model):
class Meta:
ordering = ('position', )
ordering = ('position', 'date')
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)

View file

@ -63,10 +63,10 @@ def timeline(request):
},
"unique_id": event.slug
})
if self.media:
if event.media:
timeline['events'][-1]['media'] = {
"url": self.media,
"caption": self.media_caption,
"url": event.media,
"caption": event.media_caption,
}
context['timeline_json'] = json.dumps(timeline)
return render(request, 'timeline.html', context)