2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 21:17:07 +00:00

Fixing bugs and better error msgs

This commit is contained in:
Philip Sargent
2022-10-06 21:02:15 +03:00
parent 8d08a67302
commit 70709c505c
4 changed files with 167 additions and 121 deletions

View File

@@ -398,7 +398,8 @@ def survexcaveslist(request):
It can find caves which have not yet been properly registered in the system by Databasereset.py because
someone may have uploaded the survex files without doing the rest of the integration process.
'''
# TO DO - filter out the non-public caves from display UNLESS LOGGED INS
# TO DO - filter out the non-public caves from display UNLESS LOGGED IN
# This is very impenetrable code, original from Aaron Curtis I think.
onefilecaves = [ ]
multifilecaves = [ ]
subdircaves = [ ]
@@ -422,6 +423,8 @@ def survexcaveslist(request):
# This all assumes that the first .svx file has the same name as the cave name,
# which usually but not always true. e.g. caves-1623/78/allkaese.svx not caves-1623/78/78.svx
# which is why we now also pass through the cavedir
# Still fails for loutitohoehle etc even though this is set correctly when the pending cave is created
cavesdir = get_survexareapath(area)
gcavedir = os.path.join(cavesdir, cavedir)
if os.path.isdir(gcavedir) and cavedir[0] != ".":
@@ -493,11 +496,12 @@ def survexcavesingle(request, survex_cave):
def check_cave_registered(area, survex_cave):
'''Checks whether a cave has been properly registered when it is found in the Loser repo
This should be called by Databasereset not here in a view
This should really be called by Databasereset not here in a view
Currently Caves are only registered if they are listed in :expoweb: settings.CAVEDESCRIPTIONS
so we need to add in any more here.
This function runs but does not seem to be used?!
A serious bodge anyway.
'''
try:
cave = Cave.objects.get(kataster_number=survex_cave)