summaryrefslogtreecommitdiffstats
path: root/core/views
diff options
context:
space:
mode:
Diffstat (limited to 'core/views')
-rw-r--r--core/views/caves.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/views/caves.py b/core/views/caves.py
index a21bc90..8d44b5c 100644
--- a/core/views/caves.py
+++ b/core/views/caves.py
@@ -405,7 +405,10 @@ def edit_cave(request, path="", slug=None):
Warning. This uses Django deep magic in the CaveForm processing.
It saves the data into into the database and into the html file, which it then commits to git.
+
+ We basically ignore the <path> as the <slug> is of the format 1624-114 and contains the area code
"""
+ #print(f"edit_cave(): {path=} {slug=}")
message = ""
if slug is not None:
try:
@@ -454,8 +457,14 @@ def edit_cave(request, path="", slug=None):
else:
if slug is not None:
# re-read cave data from file.
+ #print(f"edit_cave(): {cave=} {cave.filename=}")
+ #print(f"edit_cave(): {cave.slug()=}")
if cave.filename:
- read_cave(cave.filename, cave=cave)
+ try:
+ read_cave(cave.filename, cave=cave)
+ except Exception as e:
+ print(f"edit_cave(): EXCEPTION attempting to read_cave()\n{e}")
+ raise
form = CaveForm(instance=cave, initial={'cave_slug': cave.slug()})
#ceFormSet = CaveAndEntranceFormSet(queryset=cave.caveandentrance_set.all())