, replace raise with error msg

This commit is contained in:
Philip Sargent 2021-05-13 21:46:29 +03:00
parent ac11c56ca0
commit 6410cc1090

View File

@ -236,8 +236,6 @@ def rendercave(request, cave, slug, cave_id=''):
return r return r
except: except:
raise raise
return render(request,'errors/generic.html', {'cave_editable': editable, 'settings': settings, 'cave': cave, 'cavepage': True,
'cave_id': cave_id, 'svxstem': svxstem, 'svx3d':svx3d})
def cavepage(request, karea, subpath): def cavepage(request, karea, subpath):
@ -262,8 +260,8 @@ def cavepage(request, karea, subpath):
# we should have a -several variant for the cave pages, not just the svxcaves: # we should have a -several variant for the cave pages, not just the svxcaves:
return render(request, 'svxcaveseveral.html', {'settings': settings, "caves":caves }) return render(request, 'svxcaveseveral.html', {'settings': settings, "caves":caves })
except: except:
raise message = f'Failed to find cave: {path}'
return render(request, 'pagenotfound.html', {'path': path}) # it does not seem possible to set the status_code to '404' return render(request,'errors/generic.html', {'message': message})
def cave(request, cave_id='', offical_name=''): def cave(request, cave_id='', offical_name=''):
'''Displays a cave description page '''Displays a cave description page