diff --git a/.travis.yml b/.travis.yml index 2c07f0f..1a36fb2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,12 +6,15 @@ cache: - eggs - parts/node addons: - firefox: latest-esr + firefox: 45.8.0esr env: - PLONE_VERSION=4.3 - PLONE_VERSION=5.0 - PLONE_VERSION=5.1 matrix: + # FIXME: https://github.com/plone/Products.CMFPlone/issues/2126 + allow_failures: + - env: PLONE_VERSION=5.0 fast_finish: true install: - sed -ie "s#test-4.3#test-$PLONE_VERSION#" buildout.cfg diff --git a/CHANGES.rst b/CHANGES.rst index 3cb40f6..19301c3 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,8 @@ Changelog 1.2b2 (unreleased) ------------------ -- Nothing changed yet. +- Avoid ``AttributeError`` on transform chain caused by invalid output on ``recent-updates`` view when there are no new micro-updates available (refs. `plone.protect#64 `_). + [rodfersou] 1.2b1 (2016-06-21) diff --git a/src/collective/liveblog/browser/recent_updates.py b/src/collective/liveblog/browser/recent_updates.py index 90fb3bb..4a0eec1 100644 --- a/src/collective/liveblog/browser/recent_updates.py +++ b/src/collective/liveblog/browser/recent_updates.py @@ -82,6 +82,12 @@ def __call__(self): self.request.RESPONSE.setHeader('Cache-Control', 'public') self.request.RESPONSE.setHeader('Expires', expires) self.request.RESPONSE.setHeader('Last-Modified', last_modified) + + # https://github.com/plone/plone.protect/issues/64 + self.latest_microupdates = self.get_latest_microupdates() + if len(self.latest_microupdates) == 0: + return '' + return self.index() # FIXME: caching this function will speed up the rendering of this diff --git a/src/collective/liveblog/browser/templates/recent_updates.pt b/src/collective/liveblog/browser/templates/recent_updates.pt index 566e9e6..649906c 100644 --- a/src/collective/liveblog/browser/templates/recent_updates.pt +++ b/src/collective/liveblog/browser/templates/recent_updates.pt @@ -6,7 +6,7 @@