From 43724f1cf6e51ecc7d2a427511473d7f256dc729 Mon Sep 17 00:00:00 2001 From: Martin Green Date: Mon, 8 May 2023 23:09:15 +0100 Subject: [PATCH] When reloading a cave, do so from cave.filename, rather than inorrectly assuming the cave is named after its slug --- core/views/caves.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/views/caves.py b/core/views/caves.py index 0d69b74..c468362 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -389,8 +389,7 @@ def edit_cave(request, path="", slug=None): else: if slug is not None: # re-read cave data from file. - filename = str(cave.slug() +".html") - read_cave(filename, cave=cave) + read_cave(cave.filename, cave=cave) form = CaveForm(instance=cave, initial={'cave_slug': cave.slug()}) ceFormSet = CaveAndEntranceFormSet(queryset=cave.caveandentrance_set.all())