From 5aac2806186639852765828c7fa9ba55d5933bc5 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 30 Dec 2021 00:56:09 +0000 Subject: [PATCH] Bug fix and extra comment --- parsers/logbooks.py | 11 +++++++---- urls.py | 8 ++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 6b6c121..a1dd5ff 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -680,10 +680,13 @@ def LoadLogbooks(): TROG['pagecache']['expedition'][expo.year] = None # clear cache if expo.year not in nologbook: print((" - Logbook for: " + expo.year)) - numentries = LoadLogbookForExpedition(expo, entries[expo.year]) # this actually loads the logbook for one year - log.write("{} {:5d} should be {}\n".format(expo.year, numentries, entries[expo.year])) - nlbe[expo.year]=numentries - expd[expo.year]= 0 + if expo.year in entries: + numentries = LoadLogbookForExpedition(expo, entries[expo.year]) # this actually loads the logbook for one year + log.write("{} {:5d} should be {}\n".format(expo.year, numentries, entries[expo.year])) + nlbe[expo.year]=numentries + expd[expo.year]= 0 + else: + print((" - No Logbook yet for: " + expo.year)) # catch case when preparing for next expo print("** total trips in ObjStore:", len(trips)) #for i in logdataissues: # print("{:15s}: {}".format(i, logdataissues[i])) diff --git a/urls.py b/urls.py index 3c8cc19..49c7105 100644 --- a/urls.py +++ b/urls.py @@ -72,7 +72,7 @@ else: # accounts/reset/done/ [name='password_reset_complete'] trogglepatterns = [ - path('expofiles/', include(expofilesurls)), + path('expofiles/', include(expofilesurls)), # intercepted by Apache, if it is running. path('expofiles', include(expofilesurls)), # curious interaction with the include() here, not just a slash problem. re_path(r'^caves$', caves.caveindex, name="caveindex"), @@ -121,10 +121,10 @@ trogglepatterns = [ re_path(r'^cave/3d/(?P[^/]+)$', caves.cave3d, name="cave3d"), re_path(r'^cave/description/([^/]+)/?$', caves.caveDescription), - re_path(r'^cave/(?P[^/]+)/?$', caves.cave, name="cave"), #!!!BAD, local links fail + re_path(r'^cave/(?P[^/]+)/?$', caves.cave, name="cave"), #!!!BAD, local links fail.. to be checked.. re_path(r'^cave/(?P[^/]+)/?(?P[^/])$', ent), # view_caves.ent re_path(r'^cave/(?P[^/]+)/edit/$', caves.edit_cave, name="edit_cave"), - re_path(r'^(?P\d\d\d\d)(?P.*)$', cavepage, name="cavepage"), # shorthand /1623/264 BUT url links may break + re_path(r'^(?P\d\d\d\d)(?P.*)$', cavepage, name="cavepage"), # shorthand /1623/264 BUT url links break! Stop this.. # Note that urls eg '1623/161/l/rl89a.htm' are handled by cavepage which redirects them to 'expopage' # Entrances @@ -213,6 +213,6 @@ urlpatterns = [ # Alias /favicon.ico /home/expo/static/favicon.ico # to be changed # Alias /static/ /home/expo/static/ -# ScriptAlias /repositories /home/expo/config/apache/services/hgweb/hgweb.cgi +# ScriptAlias /repositories /home/expo/config/apache/services/hgweb/hgweb.cgi # UPDATE thios for git # ScriptAlias /boe /home/expo/boe/boc/boc.pl # ScriptAlias /boe-lastyear /home/expo/boe/boc-previous/boc.pl