[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 11059 42a4d52dc88d
parent 10630 d82b531fecd9
child 11098 7eb9e3e254bc
[views] fix ProcessInformationView: SESSION_MANAGER can be None (closes #5753280) eg. with pyramid. (grafted from 6a07c2dc3d85f4de0cf48221607e02c4473e11e4)
web/views/debug.py
--- a/web/views/debug.py	Tue Oct 06 18:59:01 2015 +0200
+++ b/web/views/debug.py	Mon Jul 27 10:00:32 2015 +0200
@@ -126,8 +126,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: