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

eg. with pyramid. (grafted from 6a07c2dc3d85f4de0cf48221607e02c4473e11e4)

authorDavid Douard <david.douard@logilab.fr>
changeset42a4d52dc88d
branchdefault
phasepublic
hiddenno
parent revision#d82b531fecd9 Added tag 3.19.13, debian/3.19.13-1, centos/3.19.13-1 for changeset f933a38d7ab5
child revision#cf0db566cb35 [notification] avoid using InternalManager when we've got a CWUser, #7eb9e3e254bc merge 3.19 heads
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 42a4d52dc88d88cd4dc5443fcba66eecef09f1d7
# Parent d82b531fecd95dc755646d0fee67b9c86fe5ab33
[views] fix ProcessInformationView: SESSION_MANAGER can be None (closes #5753280)

eg. with pyramid.
(grafted from 6a07c2dc3d85f4de0cf48221607e02c4473e11e4)

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: