From 83d058221dae2d33548ecbceae42e11ec6ccb0e1 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 6 Sep 2023 13:20:29 +0300 Subject: Fixed survex file list for one or more caves --- core/models/caves.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'core/models/caves.py') diff --git a/core/models/caves.py b/core/models/caves.py index d272744..e8cfeea 100644 --- a/core/models/caves.py +++ b/core/models/caves.py @@ -490,10 +490,9 @@ def GetCaveLookup(): Used when parsing wallets contents.json file too in views/uploads.py - Does NOT detect duplicates! Needs fixing. - Needs to be a proper funciton that raises an exception if there is a duplicate. + Needs to be a proper function that raises an exception if there is a duplicate. OR we could set it to return None if there are duplicates, and require the caller to - fall back on doing the actual database query it wants rather thna using this cache shortcut + fall back on doing the actual database query it wants rather than using this cache shortcut """ duplicates = {} @@ -506,10 +505,7 @@ def GetCaveLookup(): else: if cave == Gcavelookup[id]: pass # same id, same cave - else: # same id but different cave - # message = f" - Warning: ignoring alias id '{id:3}'. Caves '{Gcavelookup[id]}' and '{cave}'. " - # print(message) - # DataIssue.objects.create(parser="aliases", message=message) + else: # same id but different cave, e.g. 122 => 1623-122 and 1626-122 duplicates[id] = 1 global Gcavelookup @@ -689,7 +685,7 @@ def GetCaveLookup(): Gcavelookup[i[0]] = Gcavelookup[i[1]] else: message = f" * Coding or cave existence mistake, cave for id '{i[1]}' does not exist. Expecting to set alias '{i[0]}' to it" - # print(message) + print(message) DataIssue.objects.create(parser="aliases", message=message) addmore = {} -- cgit v1.2.3