diff --git a/CHANGELOG.md b/CHANGELOG.md index f8e40b7..d3321c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Matemat Changelog + +## Version 0.3.2 + +Caching fix + +### Changes + + +- Cache busting for profile and product pictures + + + + ## Version 0.3.1 diff --git a/matemat/__init__.py b/matemat/__init__.py index 81cfc8c..8299a60 100644 --- a/matemat/__init__.py +++ b/matemat/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.3.1' +__version__ = '0.3.2' diff --git a/matemat/webserver/pagelets/admin.py b/matemat/webserver/pagelets/admin.py index 18126e3..6a73da5 100644 --- a/matemat/webserver/pagelets/admin.py +++ b/matemat/webserver/pagelets/admin.py @@ -1,4 +1,5 @@ import os +from datetime import datetime from io import BytesIO from shutil import copyfile @@ -47,9 +48,10 @@ def admin(): users = db.list_users() products = db.list_products() # Render the "Admin/Settings" page + now = str(int(datetime.utcnow().timestamp())) return template.render('admin.html', authuser=user, authlevel=authlevel, users=users, products=products, - receipt_preference_class=ReceiptPreference, + receipt_preference_class=ReceiptPreference, now=now, setupname=config['InstanceName'], config_smtp_enabled=config['SmtpSendReceipts']) diff --git a/matemat/webserver/pagelets/main.py b/matemat/webserver/pagelets/main.py index 8a521a6..5b52be9 100644 --- a/matemat/webserver/pagelets/main.py +++ b/matemat/webserver/pagelets/main.py @@ -1,3 +1,5 @@ +from datetime import datetime + from bottle import route, redirect from matemat.db import MatematDatabase @@ -12,6 +14,7 @@ def main_page(): """ config = get_app_config() session_id: str = session.start() + now = str(int(datetime.utcnow().timestamp())) with MatematDatabase(config['DatabaseFile']) as db: # Check whether a user is logged in if session.has(session_id, 'authenticated_user'): @@ -26,7 +29,7 @@ def main_page(): # Prepare a response with a jinja2 template return template.render('productlist.html', authuser=user, users=users, products=products, authlevel=authlevel, - stock=get_stock_provider(), setupname=config['InstanceName']) + stock=get_stock_provider(), setupname=config['InstanceName'], now=now) else: # If there are no admin users registered, jump to the admin creation procedure if not db.has_admin_users(): @@ -34,5 +37,5 @@ def main_page(): # If no user is logged in, fetch the list of users and render the userlist template users = db.list_users(with_touchkey=True) return template.render('userlist.html', - users=users, setupname=config['InstanceName'], + users=users, setupname=config['InstanceName'], now=now, signup=(config.get('SignupEnabled', '0') == '1')) diff --git a/matemat/webserver/pagelets/modproduct.py b/matemat/webserver/pagelets/modproduct.py index 9200f62..75942a0 100644 --- a/matemat/webserver/pagelets/modproduct.py +++ b/matemat/webserver/pagelets/modproduct.py @@ -1,5 +1,6 @@ import os from io import BytesIO +from datetime import datetime from typing import Dict import magic @@ -55,9 +56,10 @@ def modproduct(): redirect('/admin') # Render the "Modify Product" page + now = str(int(datetime.utcnow().timestamp())) return template.render('modproduct.html', authuser=authuser, product=product, authlevel=authlevel, - setupname=config['InstanceName']) + setupname=config['InstanceName'], now=now) def handle_change(args: FormsDict, files: FormsDict, product: Product, db: MatematDatabase) -> None: diff --git a/matemat/webserver/pagelets/moduser.py b/matemat/webserver/pagelets/moduser.py index 0e5546b..dd212ab 100644 --- a/matemat/webserver/pagelets/moduser.py +++ b/matemat/webserver/pagelets/moduser.py @@ -1,4 +1,5 @@ import os +from datetime import datetime from io import BytesIO from typing import Dict, Optional @@ -55,8 +56,9 @@ def moduser(): redirect('/admin') # Render the "Modify User" page + now = str(int(datetime.utcnow().timestamp())) return template.render('moduser.html', - authuser=authuser, user=user, authlevel=authlevel, + authuser=authuser, user=user, authlevel=authlevel, now=now, receipt_preference_class=ReceiptPreference, setupname=config['InstanceName'], config_smtp_enabled=config['SmtpSendReceipts']) diff --git a/package/debian/matemat/DEBIAN/control b/package/debian/matemat/DEBIAN/control index f69b8b7..9204d2a 100644 --- a/package/debian/matemat/DEBIAN/control +++ b/package/debian/matemat/DEBIAN/control @@ -1,5 +1,5 @@ Package: matemat -Version: 0.3.1 +Version: 0.3.2 Maintainer: s3lph <1375407-s3lph@users.noreply.gitlab.com> Section: web Priority: optional diff --git a/templates/admin_all.html b/templates/admin_all.html index 47f613b..93b688b 100644 --- a/templates/admin_all.html +++ b/templates/admin_all.html @@ -31,7 +31,7 @@