From 57958bc597064bf00f64f1e5a5ec5563afc4835d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Fri, 4 May 2012 11:42:27 +0200 Subject: [PATCH] homenews: do not fail on missing picture --- tabellio/pcfviews/homenews.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tabellio/pcfviews/homenews.py b/tabellio/pcfviews/homenews.py index 8bb5061..fe4b27b 100644 --- a/tabellio/pcfviews/homenews.py +++ b/tabellio/pcfviews/homenews.py @@ -27,6 +27,8 @@ class View(grok.View): class PictureView(BrowserView): def __call__(self): + if not self.context.picture: + return None self.request.response.setHeader('Content-type', self.context.picture.contentType) return self.context.picture.data