Skip to content

Commit

Permalink
corrige erro de exibicao do portlet de calendario
Browse files Browse the repository at this point in the history
  • Loading branch information
winstonf88 committed Mar 21, 2016
1 parent eb3d45c commit 1f2d5df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Alterações
1.0.2 (unreleased)
^^^^^^^^^^^^^^^^^^

- Nothing changed yet.

- Corrige erro de exibição do portlet de calendário (closes `#58`_).
[winstonf88]

1.0.1 (2016-03-04)
^^^^^^^^^^^^^^^^^^
Expand Down
6 changes: 4 additions & 2 deletions src/brasil/gov/agenda/portlets/calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from brasil.gov.agenda.interfaces import IAgenda
from collective.portlet.calendar import calendar
from plone import api
from plone.memoize.compress import xhtml_compress
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile

Expand All @@ -25,8 +26,9 @@ def render(self):
return xhtml_compress(self._template())

def is_agenda(self):
root_path = self.root()
root = self.context.restrictedTraverse(root_path)
catalog = api.portal.getToolByName(self.context, 'portal_catalog')
root = catalog(path=self.root())
root = root[0].getObject() if root else None
return IAgenda.providedBy(root)

def root_url(self):
Expand Down

0 comments on commit 1f2d5df

Please sign in to comment.