From b9ad70bc652c43fb141313cdfb3256eb22e14e84 Mon Sep 17 00:00:00 2001 From: hernani Date: Thu, 2 Sep 2010 01:28:10 +0000 Subject: [PATCH] Moves the try clause up a bit in the ui renderer to catch possible exceptions before the actual rendering. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@583 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/templatetags/ui_registry.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/forum/templatetags/ui_registry.py b/forum/templatetags/ui_registry.py index 1e76972..02d90ea 100644 --- a/forum/templatetags/ui_registry.py +++ b/forum/templatetags/ui_registry.py @@ -15,16 +15,16 @@ class LoadRegistryNode(template.Node): result = '' for ui_object in self.registry: - if ui_object.can_render(context): - try: - if result: - result += separator - result += ui_object.render(context) - except Exception, e: - import traceback - logging.error("Exception %s rendering ui objects %s: \n%s" % ( - e, ui_object, traceback.format_exc() - )) + try: + if ui_object.can_render(context): + if result: + result += separator + result += ui_object.render(context) + except Exception, e: + import traceback + logging.error("Exception %s rendering ui objects %s: \n%s" % ( + e, ui_object, traceback.format_exc() + )) return result -- 2.39.5