[views/debug] Do not show all web sessions without CNX, just count them (closes #2602161) stable
authorpwatteyne
Tue, 29 Jan 2013 16:57:44 +0100
branchstable
changeset 8714 b70295aaed9d
parent 8710 becbbbc840b8
child 8715 ab0cd0765076
[views/debug] Do not show all web sessions without CNX, just count them (closes #2602161)
web/views/debug.py
--- a/web/views/debug.py	Mon Mar 04 17:22:57 2013 +0100
+++ b/web/views/debug.py	Tue Jan 29 16:57:44 2013 +0100
@@ -131,10 +131,13 @@
             sessions = SESSION_MANAGER.current_sessions()
             w(u'<h3>%s</h3>' % _('opened web sessions'))
             if sessions:
+                n_no_cnx_sessions = 0
                 w(u'<ul>')
                 for session in sessions:
                     if not session.cnx:
-                        w(u'<li>%s (NO CNX)</li>' % session.sessionid)
+                        # We do not want to list all sessions without cnx
+                        # Their session ID are useless, hence we just count them
+                        n_no_cnx_sessions += 1
                         continue
                     try:
                         last_usage_time = session.cnx.check()
@@ -148,6 +151,9 @@
                     dict_to_html(w, session.data)
                     w(u'</li>')
                 w(u'</ul>')
+                if n_no_cnx_sessions > 0:
+                    w(u'<h3>%s %s</h3>' % (n_no_cnx_sessions,
+                                           _('web sessions without CNX')))
             else:
                 w(u'<p>%s</p>' % _('no web sessions found'))