Skip to content

Commit

Permalink
Don't use session storage anymore - does not work with plone 5 for an…
Browse files Browse the repository at this point in the history
…onymous users.
  • Loading branch information
Mathias Leimgruber committed Feb 3, 2020
1 parent 878dc60 commit afdad67
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Changelog
1.6.7 (unreleased)
------------------

- Nothing changed yet.
- Don't use session storage anymore - does not work with plone 5 for anonymous users. [mathias.leimgruber]


1.6.6 (2020-01-17)
Expand Down
8 changes: 6 additions & 2 deletions ftw/pdfgenerator/browser/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from Products.Five import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from ftw.pdfgenerator.interfaces import DEBUG_MODE_SESSION_KEY
from ftw.pdfgenerator.interfaces import IPDFAssembler
from plone import api
from Products.Five import BrowserView
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from zope.component import getMultiAdapter


Expand Down Expand Up @@ -31,6 +32,9 @@ def allow_alternate_output(self):
if user.has_permission('cmf.ManagePortal', self.context):
return True

elif api.user.is_anonymous():
return False

elif self.request.SESSION.get(DEBUG_MODE_SESSION_KEY, False):
return True

Expand Down

0 comments on commit afdad67

Please sign in to comment.