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

Plone 5.1 #3

Merged
merged 2 commits into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion development.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[buildout]
extends =
test-plone-4.3.x.cfg
test-plone-5.1.x.cfg
https://raw.github.com/4teamwork/ftw-buildouts/master/plone-development.cfg
2 changes: 1 addition & 1 deletion docs/HISTORY.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Changelog
1.3 (unreleased)
----------------

- Nothing changed yet.
- Add plone 5.1 compatibility [Nachtalb]


1.2 (2018-05-01)
Expand Down
9 changes: 7 additions & 2 deletions ftw/publisher/controlling/browser/sender/controlling.pt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@
Last update:
<span i18n:name="date" tal:replace="view/last_updated" />
</p>
<a href="./@@publisher-controlling-refresh-statistics" id="refresh_statistics"
i18n:translate="button_refresh_statistics">Refresh Statistics</a>
<form action="@@publisher-controlling-refresh-statistics" method="POST">
<button id="refresh_statistics"
i18n:translate="button_refresh_statistics">
Refresh Statistics
</button>
<span tal:replace="structure context/@@authenticator/authenticator"/>
</form>
</fieldset>
<br />

Expand Down
7 changes: 6 additions & 1 deletion ftw/publisher/controlling/browser/sender/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
from ftw.publisher.controlling.interfaces import IStatisticsCacheController
from ftw.publisher.sender.workflows import interfaces
from ftw.table.interfaces import ITableGenerator
from plone.protect import CheckAuthenticator
from plone.protect import PostOnly
from plone.protect import protect
from zope.component import getAdapters
from zope.component import getUtility
from zope.i18n import translate
Expand Down Expand Up @@ -86,7 +89,9 @@ def last_updated(self):

class RefreshStatistics(BrowserView):

def __call__(self):
@protect(PostOnly)
@protect(CheckAuthenticator)
def __call__(self, REQUEST=None):
portal = self.context.portal_url.getPortalObject()
controller = IStatisticsCacheController(portal)
controller.rebuild_cache()
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
# http://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Framework :: Plone',
'Framework :: Plone :: 4.3',
'Framework :: Plone :: 5.1',
'License :: OSI Approved :: GNU General Public License v2 (GPLv2)',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
Expand Down
5 changes: 5 additions & 0 deletions test-plone-5.1.x.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[buildout]
extends =
https://raw.github.com/4teamwork/ftw-buildouts/master/test-plone-5.1.x.cfg

package-name = ftw.publisher.controlling