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

authorDavid Douard <david.douard@logilab.fr>
changeset17d3cd771c65
branchdefault
phasepublic
hiddenno
parent revision#8a108e2424d3 Added tag 1.1.0, debian/1.1.0-1, centos/1.1.0-1 for changeset ce24058a3b40
child revision#55d19943ebac [views] Prevent dismissal of log in form when called directly (closes #5686076)
files modified by this revision
views/debug.py
# HG changeset patch
# User David Douard <david.douard@logilab.fr>
# Date 1438079999 -7200
# Tue Jul 28 12:39:59 2015 +0200
# Node ID 17d3cd771c6542b123f9067f6bc0a056aabe2352
# Parent 8a108e2424d35b62e0996766f32b3dfb824afac2
[views] fix ProcessInformationView: SESSION_MANAGER can be None (closes #5758401)

diff --git a/views/debug.py b/views/debug.py
@@ -83,12 +83,12 @@
1      w(u'<tr><th>%s</th><td>%s</td></tr>' % (
2          _('base url'), req.base_url()))
3      w(u'<tr><th>%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: