summaryrefslogtreecommitdiffstats
path: root/parsers/caves.py
diff options
context:
space:
mode:
authorMartin Green <martin.speleo@gmail.com>2023-04-30 21:06:57 +0100
committerMartin Green <martin.speleo@gmail.com>2023-04-30 21:06:57 +0100
commitc50236575f656ac397946d30a85a112cc675cdb6 (patch)
tree3cbde236a91eaf23e3781ca2dde5c600a6343862 /parsers/caves.py
parente8d1265ee4ab2f1adf235c90d755ec7123e48f71 (diff)
downloadtroggle-c50236575f656ac397946d30a85a112cc675cdb6.tar.gz
troggle-c50236575f656ac397946d30a85a112cc675cdb6.tar.bz2
troggle-c50236575f656ac397946d30a85a112cc675cdb6.zip
Dummy entrances were being written to a global variable, recording that they have a filename. But the filename was not written. This was then causing an exception when the user asked to edit a cave, leading to all entrances being reread. Obviously the dummy entrances file ould not be read.
PS. Do we really want to reread all entrances when we start editing a cave?
Diffstat (limited to 'parsers/caves.py')
-rw-r--r--parsers/caves.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/parsers/caves.py b/parsers/caves.py
index fbe9788..8a611ec 100644
--- a/parsers/caves.py
+++ b/parsers/caves.py
@@ -73,9 +73,9 @@ def set_dummy_entrance(id, slug, cave, msg="DUMMY"):
Entrance field either missing or holds a null string instead of a filename in a cave_data file."""
global entrances_xslug
try:
- entrance = dummy_entrance(id, slug, msg="DUMMY")
- entrances_xslug[slug] = entrance
- #Note the below line, just creates a dastabase entry and not a file, this then breaks entrance editing by the website. I am not sure if we want entrances automagically created. Therefore I have commented it out. MJG
+ #Note the below line, just creates a dastabase entry, sets the global variable entrances_xslug and not a file, this then breaks entrance editing by the website. I am not sure if we want entrances automagically created. Therefore I have commented it out. Perhaps entrances_xslug is being saved with the worng filename, breaking edit_caves. MJG
+ #entrance = dummy_entrance(id, slug, msg="DUMMY")
+ #entrances_xslug[slug] = entrance
#CaveAndEntrance.objects.update_or_create(cave=cave, entrance_letter="", entrance=entrance)
#message = f" - Note: Dummy Entrance successfully set for entrance {id} on cave {cave}"
message = f" - Note: Missing Entrance for entrance {id} on cave {cave}"