Skip to content

Commit

Permalink
Fix exception related with new version of plone protect related with …
Browse files Browse the repository at this point in the history
…returning empty string in the browser view
  • Loading branch information
rodfersou committed Aug 14, 2017
1 parent efb2d97 commit 7a8e014
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGES.rst
Expand Up @@ -4,7 +4,8 @@ Changelog
1.2b2 (unreleased)
------------------

- Nothing changed yet.
- Fix exception related with new version of plone protect related with returning empty string in the browser view (fixes `#64`_).
[rodfersou]


1.2b1 (2016-06-21)
Expand Down Expand Up @@ -140,3 +141,4 @@ Changelog
.. _`#19`: https://github.com/collective/collective.liveblog/issues/19
.. _`#31`: https://github.com/collective/collective.liveblog/issues/31
.. _`#32`: https://github.com/collective/collective.liveblog/issues/32
.. _`#64`: https://github.com/collective/collective.liveblog/issues/64
4 changes: 4 additions & 0 deletions src/collective/liveblog/browser/recent_updates.py
Expand Up @@ -82,6 +82,10 @@ def __call__(self):
self.request.RESPONSE.setHeader('Cache-Control', 'public')
self.request.RESPONSE.setHeader('Expires', expires)
self.request.RESPONSE.setHeader('Last-Modified', last_modified)
self.latest_microupdates = self.get_latest_microupdates()
# https://github.com/plone/plone.protect/issues/64
if len(self.latest_microupdates) == 0:
return ''
return self.index()

# FIXME: caching this function will speed up the rendering of this
Expand Down
Expand Up @@ -6,7 +6,7 @@
<body tal:omit-tag="">
<section id="micro-updates" tal:omit-tag="">
<article class="microupdate" data-timestamp="" itemprop="comment" itemscope itemtype="http://schema.org/Comment"
tal:repeat="update view/get_latest_microupdates"
tal:repeat="update view/latest_microupdates"
tal:attributes="data-timestamp update/timestamp">
<h2 class="microupdate-title" itemprop="headline"
tal:condition="update/title"
Expand Down

0 comments on commit 7a8e014

Please sign in to comment.