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

Better error msgs for bad slugs

This commit is contained in:
Philip Sargent
2021-12-05 21:23:06 +00:00
parent bb97b7c862
commit b3aa99f008
6 changed files with 149 additions and 44 deletions

View File

@@ -121,14 +121,14 @@ trogglepatterns = [
re_path(r'^cave/3d/(?P<cave_id>[^/]+)$', caves.cave3d, name="cave3d"),
re_path(r'^cave/description/([^/]+)/?$', caves.caveDescription),
re_path(r'^cave/(?P<cave_id>[^/]+)/?$', caves.cave, name="cave"),
re_path(r'^cave/(?P<cave_id>[^/]+)/?$', caves.cave, name="cave"), #!!!BAD, local links fail
re_path(r'^cave/(?P<cave_id>[^/]+)/?(?P<ent_letter>[^/])$', ent), # view_caves.ent
re_path(r'^cave/(?P<slug>[^/]+)/edit/$', caves.edit_cave, name="edit_cave"),
re_path(r'^(?P<karea>\d\d\d\d)(?P<subpath>.*)$', cavepage, name="cavepage"), # shorthand /1623/264 BUT url links may break
# Note that urls eg '1623/161/l/rl89a.htm' are handled by cavepage which redirects them to 'expopage'
# Entrances
re_path(r'^cave/entrance/([^/]+)/?$', caves.caveEntrance), # lists all entrances
re_path(r'^cave/entrance/([^/]+)/?$', caves.caveEntrance), # lists all entrances !!!BAD, local links fail
re_path(r'^entrance/(?P<caveslug>[^/]+)/(?P<slug>[^/]+)/edit/', caves.edit_entrance, name = "editentrance"), #edit existing entrance
re_path(r'^entrance/new/(?P<caveslug>[^/]+)$', caves.edit_entrance, name = "newentrance"), # new entrance for a cave