Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erro ao renderizar Extended calendar portlet #58

Open
idgserpro opened this issue Mar 15, 2016 · 0 comments
Open

Erro ao renderizar Extended calendar portlet #58

idgserpro opened this issue Mar 15, 2016 · 0 comments

Comments

@idgserpro
Copy link
Member

Se alguma pasta ao longo do caminho da Agenda que é raiz de um extended calendar portlet estiver despublicada, ocorre o erro abaixo, quando um usuário anônimo acessa a página que renderiza o calendário:

Traceback (most recent call last):
  File "/home/user/cache-python/eggs/plone.app.portlets-2.5.4-py2.7.egg/plone/app/portlets/manager.py", line 63, in safe_render
    return portlet_renderer.render()
  File "/home/user/sites/portal.buildout/src/brasil.gov.agenda/src/brasil/gov/agenda/portlets/calendar.py", line 22, in render
    if self.is_agenda():
  File "/home/user/sites/portal.buildout/src/brasil.gov.agenda/src/brasil/gov/agenda/portlets/calendar.py", line 29, in is_agenda
    root = self.context.restrictedTraverse(root_path)
  File "/home/user/cache-python/eggs/Zope2-2.13.23-py2.7.egg/OFS/Traversable.py", line 317, in restrictedTraverse
    return self.unrestrictedTraverse(path, default, restricted=True)
  File "/home/user/cache-python/eggs/Zope2-2.13.23-py2.7.egg/OFS/Traversable.py", line 251, in unrestrictedTraverse
    next = guarded_getattr(obj, name)
Unauthorized: You are not allowed to access 'agendas' in this context

Isso ocorre porque o método is_agenda tenta dar um restrictedTraverse no objeto que é raiz do portlet, para verificar se ele é uma Agenda. Como uma das pasta que compẽm o caminho da Agenda está despublicada, ocorre o erro.

Até por questões de performace, o ideal seria fazer isso pelo catálogo.

@winstonf88 winstonf88 self-assigned this Mar 21, 2016
@winstonf88 winstonf88 removed their assignment May 5, 2016
@idgserpro idgserpro added bug and removed in progress labels Feb 6, 2017
@hvelarde hvelarde added the 1.x label Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants