diff piecrust/serving/server.py @ 853:f070a4fc033c

core: Continue PieCrust3 refactor, simplify pages. The asset pipeline is still the only function pipeline at this point. * No more `QualifiedPage`, and several other pieces of code deleted. * Data providers are simpler and more focused. For instance, the page iterator doesn't try to support other types of items. * Route parameters are proper known source metadata to remove the confusion between the two. * Make the baker and pipeline more correctly manage records and record histories. * Add support for record collapsing and deleting stale outputs in the asset pipeline.
author Ludovic Chabant <ludovic@chabant.com>
date Sun, 21 May 2017 00:06:59 -0700
parents 4850f8c21b6e
children 08e02c2a2a1a
line wrap: on
line diff
--- a/piecrust/serving/server.py	Wed May 17 00:11:48 2017 -0700
+++ b/piecrust/serving/server.py	Sun May 21 00:06:59 2017 -0700
@@ -160,14 +160,15 @@
 
         # If we haven't found any good match, report all the places we didn't
         # find it at.
-        qp = req_page.qualified_page
-        if qp is None:
+        if req_page.page is None:
             msg = "Can't find path for '%s':" % request.path
             raise MultipleNotFound(msg, req_page.not_found_errors)
 
         # We have a page, let's try to render it.
-        render_ctx = RenderingContext(qp, force_render=True)
-        qp.page.source.prepareRenderContext(render_ctx)
+        render_ctx = RenderingContext(req_page,
+                                      sub_num=req_page.sub_num,
+                                      force_render=True)
+        req_page.page.source.prepareRenderContext(render_ctx)
 
         # Render the page.
         rendered_page = render_page(render_ctx)