Skip to content

Commit

Permalink
fix python 3 issue in transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Mar 14, 2019
1 parent b580a11 commit 45832cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions news/34.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix python 3 issue when checking referenced images in transform
[petschki]
9 changes: 6 additions & 3 deletions plone/app/textfield/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@ def check_referenced_images(self, value, target_mimetype, cache_obj):
return

# get the original save time from the cached data dict
orig_time = getattr(cache_obj, cache._id).values()[0][0]
modified_imgs = self.catalog(
UID=uids, modified=dict(query=orig_time, range="min"))
cached_values = list(getattr(cache_obj, cache._id, {}).values())
modified_imgs = []
if len(cached_values):
orig_time = cached_values[0][0]
modified_imgs = self.catalog(
UID=uids, modified=dict(query=orig_time, range="min"))

if len(modified_imgs) > 0:
cache.purgeCache()

0 comments on commit 45832cb

Please sign in to comment.