From: Robert M. <svn...@pl...> - 2008-11-18 17:10:55
|
Author: rmarianski Date: Tue Nov 18 17:10:50 2008 New Revision: 76056 Modified: listen/branches/p2.5-topp-digest-support/content/digest.py Log: dirty hack to prevent empty digest messages Modified: listen/branches/p2.5-topp-digest-support/content/digest.py ============================================================================== --- listen/branches/p2.5-topp-digest-support/content/digest.py (original) +++ listen/branches/p2.5-topp-digest-support/content/digest.py Tue Nov 18 17:10:50 2008 @@ -197,6 +197,18 @@ 'constructor': self, } msghtml = template.pt_render(extra_context=extra_context) + #XXX for some reason the template renders an empty string without this + # hack + # no idea why ... caching? + # possible exception the first time through but not the next and the + # template swalows it and returns an empty string? + if not msghtml: + try: + template() + except: + pass + msghtml = template.pt_render(extra_context=extra_context) + msgtext = render(msghtml.encode('utf-8')) # construct message object |