Pass pg context to render when rendering static pages
authorMagnus Hagander <magnus@hagander.net>
Fri, 29 Jun 2018 17:40:45 +0000 (19:40 +0200)
committerMagnus Hagander <magnus@hagander.net>
Fri, 29 Jun 2018 17:40:45 +0000 (19:40 +0200)
This is where we set both the gitrev and the do_esi, both of which are
needed. This means that gitrev has been broken on static pages since
forever - oops.

pgweb/core/views.py

index 7c2049c8a361e5d7854d4206f3c8068772bc5bf9..dc6db30e4a1e136db33b11a948cb82548f980b60 100644 (file)
@@ -18,7 +18,7 @@ import re
 import urllib
 
 from pgweb.util.decorators import cache, nocache
-from pgweb.util.contexts import render_pgweb, get_nav_menu
+from pgweb.util.contexts import render_pgweb, get_nav_menu, PGWebContextProcessor
 from pgweb.util.helpers import simple_form, PgXmlHelper, HttpServerError
 from pgweb.util.moderation import get_all_pending_moderations
 from pgweb.util.misc import get_client_ip, varnish_purge
@@ -128,7 +128,9 @@ def fallback(request, url):
                navsect = url.split('/',2)[0]
        except:
                navsect = ''
-       return HttpResponse(t.render({'navmenu': get_nav_menu(navsect)}))
+       c = PGWebContextProcessor(request)
+       c.update({'navmenu': get_nav_menu(navsect)})
+       return HttpResponse(t.render(c))
 
 # Edit-forms for core objects
 @login_required