When reloading a cave, do so from cave.filename, rather than inorrectly assuming the cave is named after its slug

This commit is contained in:
Martin Green 2023-05-08 23:09:15 +01:00
parent 7d140af87a
commit 43724f1cf6

View File

@ -389,8 +389,7 @@ def edit_cave(request, path="", slug=None):
else: else:
if slug is not None: if slug is not None:
# re-read cave data from file. # re-read cave data from file.
filename = str(cave.slug() +".html") read_cave(cave.filename, cave=cave)
read_cave(filename, cave=cave)
form = CaveForm(instance=cave, initial={'cave_slug': cave.slug()}) form = CaveForm(instance=cave, initial={'cave_slug': cave.slug()})
ceFormSet = CaveAndEntranceFormSet(queryset=cave.caveandentrance_set.all()) ceFormSet = CaveAndEntranceFormSet(queryset=cave.caveandentrance_set.all())