summaryrefslogtreecommitdiffstats
path: root/parsers/caves.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-01-16 12:57:24 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2025-01-16 12:57:24 +0000
commiteb22047c08a05613c70470f607c460827491528f (patch)
tree3d67ca7cb7df55cc0a502c88ae16d2d96b7d4e7c /parsers/caves.py
parentf4fe681524ec672de843463b1c7d66a06a9587be (diff)
downloadtroggle-eb22047c08a05613c70470f607c460827491528f.tar.gz
troggle-eb22047c08a05613c70470f607c460827491528f.tar.bz2
troggle-eb22047c08a05613c70470f607c460827491528f.zip
cover case when cave data is re-parsed online
Diffstat (limited to 'parsers/caves.py')
-rw-r--r--parsers/caves.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/parsers/caves.py b/parsers/caves.py
index 05bc159..241e30a 100644
--- a/parsers/caves.py
+++ b/parsers/caves.py
@@ -754,7 +754,8 @@ def read_cave(filename, mvf=None, cave=None):
if filename != f"{correctslug}.html" :
message = f" ! Filename is not the same as the cave slug '{slug}' != '{areacode}-{unofficial_number}' {url=} in file {filename} IGNORING caveslug field in the .html file."
DataIssue.objects.create(parser="caves", message=message, url=msgurl) # url here is for where the file actually is, for editing
- mvf.write(mvtext + "\n")
+ if mvf: # this can be called online, not just when a databaseReset is done, so mvf may be None
+ mvf.write(mvtext + "\n")
print(message)
return correctslug