Change route name from "home" to "pgwui_home"
authorKarl O. Pinc <kop@karlpinc.com>
Sat, 21 Nov 2020 21:05:48 +0000 (15:05 -0600)
committerKarl O. Pinc <kop@karlpinc.com>
Sat, 21 Nov 2020 23:43:23 +0000 (17:43 -0600)
src/pgwui_common/pgwui_common.py
src/pgwui_common/templates/auth_base.mak
src/pgwui_common/templates/base.mak
tests/test_pgwui_common.py

index 66ff8622bcdc23a1492baa44f3bf33ca90dc7566..22acaf702a43c9225d705ddbaa417b7130bda9c2 100644 (file)
@@ -35,8 +35,8 @@ def base_view(wrapped):
         pgwui = response.get('pgwui', {})
 
         routes = pgwui.setdefault('routes', dict())
-        routes.setdefault('home',
-                          request.route_url('home'))
+        routes.setdefault('pgwui_home',
+                          request.route_url('pgwui_home'))
         try:
             logout_route = request.route_url('pgwui_logout')
         except KeyError:
@@ -68,4 +68,4 @@ def includeme(config):
         'static/pgwui_common',
         'pgwui_common:static/',
         cache_max_age=3600)
-    config.add_route('home', DEFAULT_HOME_ROUTE)
+    config.add_route('pgwui_home', DEFAULT_HOME_ROUTE)
index f4842900eaad393436a8650256cb893049f29bc6..d5e28ef199d68e9b7a06cc16bcf8d48148891950 100644 (file)
@@ -52,7 +52,7 @@
 
 <%def name="navbar()">
   <p class="navbar">
-    <a href="${pgwui['routes']['home']}">HOME</a>
+    <a href="${pgwui['routes']['pgwui_home']}">HOME</a>
     % if 'pgwui_logout' in pgwui['routes']:
       | <a href="${pgwui['routes']['pgwui_logout']}">Logout</a>
     % endif
index 7cd1c920882e015d1de8bc526a1445716fb10b19..b442b648fe2efa2c2173a8a99ca652b13e1bdfff 100644 (file)
@@ -32,7 +32,7 @@
 
 <%def name="navbar()">
   <p class="navbar">
-    <a href="${pgwui['routes']['home']}">HOME</a>
+    <a href="${pgwui['routes']['pgwui_home']}">HOME</a>
   </p>
 </%def>
 
index 005bf0446aa793a5def11d3d0db5f4396b07d64e..7be6aac925a12953a9f2606ac173dff6ea55b0d8 100644 (file)
@@ -57,7 +57,7 @@ def test_base_view_add(pyramid_request_config):
     pgwui_common.includeme(pyramid_request_config)
     wrapper = pgwui_common.base_view(mock_view)
     response = wrapper(request)
-    assert response['pgwui']['routes']['home'] == url
+    assert response['pgwui']['routes']['pgwui_home'] == url
 
 
 def test_base_view_default(pyramid_request_config):
@@ -136,7 +136,7 @@ def test_includeme_configurecalled():
             self.add_static_view_called = True
 
         def add_route(self, name, route):
-            if name == 'home':
+            if name == 'pgwui_home':
                 self.home_route = route
 
     config = MockConfig()