summaryrefslogtreecommitdiffstats
path: root/core/views/logbooks.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-09-04 18:56:32 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-09-04 18:56:32 +0300
commitd3ac321d380eebf9c2d3486710c336e477363eb4 (patch)
tree8abd8bc9141283f29e0eb390a147ee9ef489d7f5 /core/views/logbooks.py
parenta5dc78b04d7d5af8f1de23154f8ca23475587785 (diff)
downloadtroggle-d3ac321d380eebf9c2d3486710c336e477363eb4.tar.gz
troggle-d3ac321d380eebf9c2d3486710c336e477363eb4.tar.bz2
troggle-d3ac321d380eebf9c2d3486710c336e477363eb4.zip
fix bugs on reload of logbook
Diffstat (limited to 'core/views/logbooks.py')
-rw-r--r--core/views/logbooks.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/views/logbooks.py b/core/views/logbooks.py
index 7934bb3..09cd6b4 100644
--- a/core/views/logbooks.py
+++ b/core/views/logbooks.py
@@ -72,18 +72,18 @@ def expedition(request, expeditionname):
)
return render(request, "errors/generic.html", {"message": message})
+ ts = TROG["pagecache"]["expedition"] # not much use unless single user!
if request.user.is_authenticated:
logged_in = True
if "reload" in request.GET:
+ if expeditionname in ts:
+ del ts[expeditionname] # clean out cache for page
expo.logbookentry_set.all().delete()
import_logbook(year=expo.year)
else:
logged_in = False
- ts = TROG["pagecache"]["expedition"] # not much use unless single user!
if settings.CACHEDPAGES:
- len(TROG["pagecache"]["expedition"])
- # print(f'! - expo {expeditionname} CACHEDPAGES {nexpos} expo pages in cache.')
if expeditionname in ts:
# print('! - expo {expeditionanme} using cached page')
return render(request, "expedition.html", {**ts[expeditionname], "logged_in": logged_in})