2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

Fix missing images

This commit is contained in:
Philip Sargent 2022-06-23 19:18:21 +03:00
parent 77cf3455a6
commit 16c6aed65f

View File

@ -262,27 +262,29 @@ def cavepage(request, karea, subpath):
kpath = karea + subpath
# print(f" ! cavepage:'{kpath}' kataster area:'{karea}' rest of path:'{subpath}'")
cave = Cave.objects.get(url = kpath) # ideally this will be unique
print(f" ! cavepage: url={kpath} -- {cave}")
try:
r = rendercave(request, cave, cave.slug())
return r
cave = Cave.objects.get(url = kpath) # ideally this will be unique
except Cave.DoesNotExist:
# probably a link to text or an image e.g. 1623/161/l/rl89a.htm i.e. an expoweb page
# cannot assume that this is a simple cave page, for a cave we don't know.
# print(f" ! cavepage: url={kpath} A cave of this name does not exist")
return expo.expopage(request, kpath)
except Cave.MultipleObjectsReturned:
caves = Cave.objects.filter(url = kpath)
# print(f" ! cavepage: url={kpath} multiple caves exist")
# we should have a -several variant for the cave pages, not just the svxcaves:
return render(request, 'svxcaveseveral.html', {'settings': settings, "caves":caves })
try:
r = rendercave(request, cave, cave.slug())
return r
except NoReverseMatch:
raise
except:
message = f'Failed to render cave: {kpath} (it does exist and is unique) because of a Django URL resolution error. Check urls.py.'
return render(request,'errors/generic.html', {'message': message})
return rendercave(request, cave, cave.slug(), cave_id=cave_id)
# return rendercave(request, cave, cave.slug(), cave_id=cave_id)
def caveEntrance(request, slug):
try: