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

improved display of survex files for a cave

This commit is contained in:
Philip Sargent
2021-03-25 20:23:25 +00:00
parent 80874887cc
commit 65c3cb31d7
2 changed files with 66 additions and 67 deletions

View File

@@ -383,19 +383,15 @@ def survexcaveslist(request):
def survexcavesingle(request, survex_cave):
'''parsing all the survex files of a single cave and showing that it's consistent and can find all
the files and people. Currently not showing Explorers or Titles. link test from SurvexFile page
is "dates and explorers". Should explicity fix the kataster number thing.
the files and people. Should explicity fix the kataster number thing.
'''
sc = survex_cave
breload = False
if breload:
parsers.survex.ReloadSurvexCave(sc) # does not exit now, needs re-writing to work.
try:
cave = Cave.objects.get(kataster_number=sc)
return render_to_response('svxcavesingle.html', {'settings': settings, "cave":cave })
except ObjectDoesNotExist:
# can get here if the survex file is in a directory labelled with unofficial number not kataster number.
# maybe - and _ mixed up, or CUCC-2017- instead of 2017-CUCC-, or CUCC2015DL01 ??
# maybe - and _ mixed up, or CUCC-2017- instead of 2017-CUCC-, or CUCC2015DL01 . Let's not get carried away..
for unoff in [sc, sc.replace('-','_'), sc.replace('_','-')]:
try:
cave = Cave.objects.get(unofficial_number=unoff)