2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

fix bugs on reload of logbook

This commit is contained in:
Philip Sargent 2023-09-04 18:56:32 +03:00
parent a5dc78b04d
commit d3ac321d38
2 changed files with 6 additions and 3 deletions

View File

@ -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})

View File

@ -543,6 +543,9 @@ def clean_logbook_for_expedition(expedition):
"""Only used when loading a single logbook. Deletes database LogBookEntries and
DataIssues for this expedition year.
"""
global tripsdate
tripsdate = {}
lbes = LogbookEntry.objects.filter(expedition=expedition).delete()
dataissues = DataIssue.objects.filter(parser="logbooks")
for di in dataissues: