From 05413ad9f80a1e335cb90ed94cc88bd14253d457 Mon Sep 17 00:00:00 2001 From: j Date: Fri, 12 Nov 2021 18:03:19 +0000 Subject: [PATCH] create context pages --- app/event/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/event/views.py b/app/event/views.py index 2166164..eb9dede 100644 --- a/app/event/views.py +++ b/app/event/views.py @@ -9,6 +9,6 @@ def index(request, slug=''): context = {} context['settings'] = settings context['events'] = Event.objects.all().order_by('position') - context['postscript'] = Page.objects.get(slug='postscript') - context['intro'] = Page.objects.get(slug='intro') + context['postscript'], c = Page.objects.get_or_create(slug='postscript') + context['intro'], c = Page.objects.get_or_create(slug='intro') return render(request, 'index.html', context)