Skip to content

Commit

Permalink
Make z3c.caching dependency explicit.
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpm committed Aug 11, 2015
1 parent aa5f003 commit 2437242
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
'zope.interface',
'zope.lifecycleevent',
'zope.schema',
'z3c.caching',
],
extras_require={
'test': [
Expand Down
9 changes: 2 additions & 7 deletions src/plone/app/imagecropping/browser/crop.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@
from plone.app.imagecropping import PAI_STORAGE_KEY
from plone.app.imagecropping.interfaces import IImageCroppingUtils
from plone.scale.storage import AnnotationStorage
from z3c.caching.purge import Purge
from zope.annotation.interfaces import IAnnotations
from zope.event import notify

import PIL.Image

try:
from z3c.caching.purge import Purge
except ImportError:
Purge = None


class CroppingView(BrowserView):

Expand Down Expand Up @@ -49,8 +45,7 @@ def _crop(self, fieldname, scale, box):
self._store(fieldname, scale, box)

# Purge caches if needed
if Purge is not None:
notify(Purge(self.context))
notify(Purge(self.context))

@property
def _storage(self):
Expand Down

0 comments on commit 2437242

Please sign in to comment.