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:
parent
a5dc78b04d
commit
d3ac321d38
@ -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})
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user