save connection between cave and entrances, before writing out the cavedata file

This commit is contained in:
Martin Green 2023-07-24 23:03:12 +01:00
parent 761a71930b
commit 380565c6f5

View File

@ -478,14 +478,13 @@ def edit_entrance(request, path="", caveslug=None, entslug=None):
entrance.cached_primary_slug = slugname
entrance.filename = slugname + ".html"
entrance.save()
entrance_letter.entrance = entrance
entrance_letter.save()
entrance_file = entrance.file_output()
print(f"Online edit of entrance {entrance.slug}")
cave_file = cave.file_output()
entrance.save()
write_and_commit([entrance_file, cave_file], f"Online edit of entrance {entrance.slug}")
entrance_letter.entrance = entrance
if entslug is None:
entrance_letter.save()
return HttpResponseRedirect("/" + cave.url)
else:
if entrance: