diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2021-04-17 01:41:06 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2021-04-17 01:41:06 +0100 |
commit | f8b613e0aaaff0cf6dde99d677bb9c5ae6b4d09d (patch) | |
tree | 912d2697c10b6f823c228dd87c3963abf1933da3 /core/views/caves.py | |
parent | 4ad7033285945243d48d9c13e853996cd864b40a (diff) | |
download | troggle-f8b613e0aaaff0cf6dde99d677bb9c5ae6b4d09d.tar.gz troggle-f8b613e0aaaff0cf6dde99d677bb9c5ae6b4d09d.tar.bz2 troggle-f8b613e0aaaff0cf6dde99d677bb9c5ae6b4d09d.zip |
prospect and moving code to better places
Diffstat (limited to 'core/views/caves.py')
-rw-r--r-- | core/views/caves.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/views/caves.py b/core/views/caves.py index dd621aa..2b97aac 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -354,7 +354,7 @@ def edit_cave(request, slug=None): }) @login_required_if_public -def editEntrance(request, caveslug, slug=None): +def edit_entrance(request, caveslug=None, slug=None): '''This is the form that edits the entrance data for a single entrance and writes out an XML file in the :expoweb: repo folder The format for the file being saved is in templates/dataformat/entrance.xml @@ -362,7 +362,10 @@ def editEntrance(request, caveslug, slug=None): It does save the data into into the database directly, not by parsing the file. ''' message = "" - cave = Cave.objects.get(caveslug__slug = caveslug) + if caveslug is not None: + cave = Cave.objects.get(caveslug__slug = caveslug) + else: + cave = Cave() if slug is not None: entrance = Entrance.objects.get(entranceslug__slug = slug) else: |