Updated view name in APM tween
authorThierry Florac <tflorac@ulthar.net>
Wed, 06 Feb 2019 09:20:26 +0100
changeset 12 64c0d548a45c
parent 11 7aab2edaf049
child 13 c9ab773046e4
Updated view name in APM tween
src/pyams_apm/tween.py
--- a/src/pyams_apm/tween.py	Fri Nov 16 15:14:12 2018 +0100
+++ b/src/pyams_apm/tween.py	Wed Feb 06 09:20:26 2019 +0100
@@ -101,6 +101,8 @@
         finally:
             try:
                 view_name = request.view_name
+                if not view_name:
+                    view_name = request.traversed[-1] if request.traversed else '/'
             except AttributeError:
                 view_name = ''
             transaction_name = request.matched_route.pattern if request.matched_route else view_name