From 560ade00b40e7d61cfdf66d071dd6152ee2347af Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Sun, 22 Nov 2020 10:03:10 +0100 Subject: [PATCH] Fix browser caching problem on change cover --- cps/jinjia.py | 6 ++++++ cps/templates/book_edit.html | 2 +- cps/templates/detail.html | 6 +++--- cps/web.py | 15 ++++++++++++--- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/cps/jinjia.py b/cps/jinjia.py index ebb53a30..688d1fba 100644 --- a/cps/jinjia.py +++ b/cps/jinjia.py @@ -25,6 +25,7 @@ from __future__ import division, print_function, unicode_literals import datetime import mimetypes +from uuid import uuid4 from babel.dates import format_date from flask import Blueprint, request, url_for @@ -127,3 +128,8 @@ def formatseriesindex_filter(series_index): return series_index return 0 +@jinjia.app_template_filter('uuidfilter') +def uuidfilter(var): + return uuid4() + + diff --git a/cps/templates/book_edit.html b/cps/templates/book_edit.html index 16c02fae..003b33f9 100644 --- a/cps/templates/book_edit.html +++ b/cps/templates/book_edit.html @@ -3,7 +3,7 @@ {% if book %}
- {{ book.title }} + {{ book.title }}
{% if g.user.role_delete_books() %}
diff --git a/cps/templates/detail.html b/cps/templates/detail.html index 260ee93a..503d1dbd 100644 --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -4,13 +4,13 @@
- {{ entry.title }} + {{ entry.title }}