Skip to content

Commit e385037

Browse files
authored
Always get and return the context (#405)
1 parent cdc19c5 commit e385037

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/core/models/content.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,16 @@ class ContentPage(Page):
4545
search_fields = Page.search_fields + [index.SearchField("body")]
4646

4747
def get_context(self, request, *args, **kwargs):
48+
context = super().get_context(request, *args, **kwargs)
49+
4850
if self.live and self.show_in_menus:
49-
context = super().get_context(request, *args, **kwargs)
5051
pages = Page.objects.live().in_menu()
5152
context.update(
5253
previous=pages.filter(path__lt=self.path).last(),
5354
next=pages.filter(path__gt=self.path).first(),
5455
)
55-
return context
56+
57+
return context
5658

5759
def serve(self, request):
5860
if request.method == "POST":

0 commit comments

Comments
 (0)