[views] fix ProcessInformationView: SESSION_MANAGER can be None (closes #5753280)

eg. with pyramid.

authorDavid Douard <david.douard@logilab.fr>
changesetae42a793cf94
branchdefault
phasedraft
hiddenyes
parent revision#2b398e58ea73 [hook] remove assumption about entity cache vs cw_edited
child revision<not specified>
files modified by this revision
web/views/debug.py
# HG changeset patch
# User David Douard <david.douard@logilab.fr>
# Date 1437984032 -7200
# Mon Jul 27 10:00:32 2015 +0200
# Node ID ae42a793cf94b5c24116ed8b6aea41ebdba99b9d
# Parent 2b398e58ea7351ceb94389ceacb7a0d091f2da6d
[views] fix ProcessInformationView: SESSION_MANAGER can be None (closes #5753280)

eg. with pyramid.

diff --git a/web/views/debug.py b/web/views/debug.py
@@ -124,12 +124,12 @@
1          w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
2              _('base url'), req.base_url()))
3          w(u'<tr><th align="left">%s</th><td>%s</td></tr>' % (
4              _('data directory url'), req.datadir_url))
5          w(u'</table>')
6 -        if req.user.is_in_group('managers'):
7 -            from cubicweb.web.application import SESSION_MANAGER
8 +        from cubicweb.web.application import SESSION_MANAGER
9 +        if SESSION_MANAGER is not None and req.user.is_in_group('managers'):
10              sessions = SESSION_MANAGER.current_sessions()
11              w(u'<h3>%s</h3>' % _('opened web sessions'))
12              if sessions:
13                  w(u'<ul>')
14                  for session in sessions: