From eb22047c08a05613c70470f607c460827491528f Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 16 Jan 2025 12:57:24 +0000 Subject: cover case when cave data is re-parsed online --- parsers/caves.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'parsers/caves.py') 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 -- cgit v1.2.3