diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2024-06-28 18:31:23 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2024-06-28 18:55:41 +0300 |
commit | 03fa36576bbfc3a1c4119a91de39d29916db7ef9 (patch) | |
tree | 85ebe16572dd472f47d87952685ffbde12dbe3fa /core/views | |
parent | 5fff060487468553ce14494efa77cb2c4f1b9176 (diff) | |
download | troggle-03fa36576bbfc3a1c4119a91de39d29916db7ef9.tar.gz troggle-03fa36576bbfc3a1c4119a91de39d29916db7ef9.tar.bz2 troggle-03fa36576bbfc3a1c4119a91de39d29916db7ef9.zip |
fixing cave_edit
Diffstat (limited to 'core/views')
-rw-r--r-- | core/views/caves.py | 11 |
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()) |