diff --git a/core/views/new_hole.py b/core/views/new_hole.py index b5fa4e8d..7686985f 100644 --- a/core/views/new_hole.py +++ b/core/views/new_hole.py @@ -439,7 +439,7 @@ def process_new_hole(form, area): Cave (if cave description, but probably not) Survex new (needs new creation page) (date, people, cave id) + list of "happened this day" at the bottom, as for other pages. - + ⚡ write new wallet if wallet does not exist yet, with people, date etc. ⚡Update the database "locations" with the new *fix (is this even possible 🧩 without reset?) writes: @@ -452,7 +452,7 @@ def process_new_hole(form, area): fix_id = f"{area}.g{form.cleaned_data.get("cave_id").lower()}" _newfix(form, area, editor, fix_id) - + # ⚡ tidy this cave = _makecave(form, area) _newent(form, area, editor, fix_id, cave) # yes, make the Entrance first _savecave(form, area, editor, cave) @@ -583,9 +583,7 @@ def _makecave(form, areacode): def _savecave(form, areacode, editor, cave): cave.save() - # need a CaveForm f we do it this way, which is a ModelForm. - # form.save_m2m() # this does the many-to-many relationship saving between caves and entrances - # can we do this manually? + try: cave_file = cave.file_output() write_and_commit([cave_file], f"Creating new cave {cave}", editor)