summaryrefslogtreecommitdiffstats
path: root/core/views/caves.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/caves.py')
-rw-r--r--core/views/caves.py7
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: