Force thumbnail refresh using timestamp
authorThierry Florac <thierry.florac@onf.fr>
Fri, 08 Dec 2017 11:27:44 +0100
changeset 70 4deac57fe036
parent 69 1583d65a8c44
child 71 43d549b611d3
Force thumbnail refresh using timestamp
src/pyams_file/widget/__init__.py
--- a/src/pyams_file/widget/__init__.py	Fri Dec 08 11:26:55 2017 +0100
+++ b/src/pyams_file/widget/__init__.py	Fri Dec 08 11:27:44 2017 +0100
@@ -105,7 +105,7 @@
         if thumbnails is not None:
             display = thumbnails.get_thumbnail('128x128', 'jpeg')
             if display is not None:
-                return absolute_url(display, self.request)
+                return '{0}?_={1}'.format(absolute_url(display, self.request), self.timestamp)
         name, ext = os.path.splitext(self.current_value.filename)
         return '/--static--/pyams_skin/img/mimetypes/{0}'.format(EXTENSIONS_THUMBNAILS.get(ext, 'unknown.png'))