You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by rj...@apache.org on 2013/05/30 20:49:21 UTC
svn commit: r1487969 -
/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py
Author: rjollos
Date: Thu May 30 18:49:20 2013
New Revision: 1487969
URL: http://svn.apache.org/r1487969
Log:
Refs #526: Show a warning message rather than an error message when the widget name is unknown.
Modified:
bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py
Modified: bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py?rev=1487969&r1=1487968&r2=1487969&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py (original)
+++ bloodhound/trunk/bloodhound_dashboard/bhdashboard/web_ui.py Thu May 30 18:49:20 2013
@@ -259,9 +259,12 @@ class DashboardModule(Component):
def _render_widget(self, wp, name, ctx, options):
"""Render widget without failing.
"""
+ if wp is None:
+ data = {'msglabel': 'Warning',
+ 'msgbody': _('Unknown widget %(name)s', name=name)}
+ return 'widget_alert.html', {'title': '', 'data': data}, ctx
+
try:
- if wp is None:
- raise InvalidIdentifier("Unknown widget ID")
return wp.render_widget(name, ctx, options)
except Exception, exc:
log_entry = str(uuid4())