فهرست منبع

Fix preview functionality on BlogIndex when route methods are present
Resolves #142

Scot Hacker 8 سال پیش
والد
کامیت
8366ec6d79
1فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
  1. 4 0
      bakerydemo/blog/models.py

+ 4 - 0
bakerydemo/blog/models.py

@@ -198,6 +198,10 @@ class BlogIndexPage(RoutablePageMixin, Page):
         }
         return render(request, 'blog/blog_index_page.html', context)
 
+    def serve_preview(self, request, mode_name):
+        # Needed for previews to work
+        return self.serve(request)
+
     # Returns the child BlogPage objects for this BlogPageIndex.
     # If a tag is used then it will filter the posts by tag.
     def get_posts(self, tag=None):