2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

track down url resoution error

This commit is contained in:
Philip Sargent 2022-07-20 10:08:23 +03:00
parent 9a395eafef
commit 2a7f1506c9

View File

@ -235,16 +235,11 @@ def rendercave(request, cave, slug, cave_id=''):
cave_id = slug # cave.unofficial_number
context = {'cave_editable': True, 'settings': settings, 'cave': cave, 'cavepage': True,
'cave_id': cave_id, 'svxstem': str(svxstem), 'svx3d':svx3d}
try:
r = render(request, templatefile, context) # crashes here with NoReverseMatch if url not set up for 'edit_cave' in urls.py
return r
except NoReverseMatch:
raise
except:
raise
message = f'Failed to render cave: {slug}'
return render(request,'errors/generic.html', {'message': message})
# Do not catch any exceptions here: propagate up to caller
r = render(request, templatefile, context) # crashes here with NoReverseMatch if url not set up for 'edit_cave' in urls.py
return r
def cavepage(request, karea, subpath):
'''Displays a cave description page
accessed by kataster area number specifically
@ -279,6 +274,7 @@ def cavepage(request, karea, subpath):
except NoReverseMatch:
raise
except:
raise
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})