From 327b1923b06bd4789df7ad0be4976e7d63c3aad5 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sun, 10 Sep 2023 02:06:38 +0300 Subject: Cleaning auto Cave creation from survex file detection --- core/views/scans.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'core/views/scans.py') diff --git a/core/views/scans.py b/core/views/scans.py index f7abc06..b998b27 100644 --- a/core/views/scans.py +++ b/core/views/scans.py @@ -95,7 +95,7 @@ def is_cave(id): print(f" - Failed to find cave object from id <{id}>") if id.lower() != "unknown" and id != "": print(f" - adding <{id}> to pendingcaves.txt list") - add_cave_to_pending_list(id) + add_cave_to_pending_list(id, f"Could not find id <{id}>") return False def fillblankothers(w): @@ -275,6 +275,11 @@ def cavewallets(request, caveid): if str(fcave.slug()) == caveid: # print(f' - Found one ! {z.walletname=} {zcaveid=}') wallets.add(z) + elif f"1623-{cleanid}" in Gcavelookup: # special hack for all the old wallets which are 1623 + fcave = Gcavelookup[f"1623-{cleanid}"] + if str(fcave.slug()) == caveid: + # print(f' - Found one ! {z.walletname=} {zcaveid=}') + wallets.add(z) elif cleanid in ['surface', 'unknown', '']: message = f" ! In {z.walletname} ignore '{cleanid}' " print(message) @@ -284,7 +289,7 @@ def cavewallets(request, caveid): message = f" ! In {z.walletname} there is an unrecognised cave name '{cleanid}', adding to pending list." print(message) DataIssue.objects.update_or_create(parser="scans", message=message, url=wurl) - add_cave_to_pending_list(cleanid) + add_cave_to_pending_list(cleanid, f"an unrecognised cave name in {z.walletname}") manywallets = list(set(wallets)) for w in manywallets: -- cgit v1.2.3