[views] fix ProcessInformationView: SESSION_MANAGER can be None (closes #5753280)
authorDavid Douard <david.douard@logilab.fr>
Mon, 27 Jul 2015 10:00:32 +0200
changeset 10574 6a07c2dc3d85
parent 10573 e4a807b49b58
child 10575 036f5964e6fe
[views] fix ProcessInformationView: SESSION_MANAGER can be None (closes #5753280) eg. with pyramid.
web/views/debug.py
--- a/web/views/debug.py	Thu Aug 06 15:21:58 2015 +0200
+++ b/web/views/debug.py	Mon Jul 27 10:00:32 2015 +0200
@@ -132,8 +132,8 @@
         w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
             _('data directory url'), req.datadir_url))
         w(u'</table>')
-        if req.user.is_in_group('managers'):
-            from cubicweb.web.application import SESSION_MANAGER
+        from cubicweb.web.application import SESSION_MANAGER
+        if SESSION_MANAGER is not None and req.user.is_in_group('managers'):
             sessions = SESSION_MANAGER.current_sessions()
             w(u'<h3>%s</h3>' % _('opened web sessions'))
             if sessions: