2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-15 12:37:10 +00:00
This commit is contained in:
2023-10-15 18:39:00 +03:00
parent c51c2326fe
commit a786f4813f
3 changed files with 18 additions and 6 deletions

View File

@@ -472,6 +472,13 @@ def read_entrance(filename, ent=None):
contents = f.read()
context = filename
# validate filename, check areacode
ent_area = filename[:4]
if ent_area not in AREACODES:
message = f'! BAD AREA CODE in "{filename}". Not recognised.'
DataIssue.objects.create(parser="entrances", message=message, url=f"/entrance_data/{filename}_edit")
print(message)
entrancecontentslist = getXML(contents, "entrance", maxItems=1, context=context)
if len(entrancecontentslist) != 1:
message = f'! BAD ENTRANCE DATA in "{filename}". More than one entrance. Edit file manually, click.'
@@ -840,7 +847,9 @@ def readcaves():
with open(fpending, "r") as fo:
cids = fo.readlines()
for cid in cids:
pending.add(cid.strip().rstrip("\n"))
pcaveid = cid.strip().rstrip("\n")
if pcaveid !="":
pending.add(pcaveid)
with transaction.atomic():
print(" - Deleting Caves and Entrances")