summaryrefslogtreecommitdiffstats
path: root/core/models/caves.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2023-09-06 13:20:29 +0300
committerPhilip Sargent <philip.sargent@gmail.com>2023-09-06 13:20:29 +0300
commit83d058221dae2d33548ecbceae42e11ec6ccb0e1 (patch)
treec968dc2f6cd88731498c2eeb8a441dcd7df319b0 /core/models/caves.py
parent38d0e855c9278b95ce749329cd69495894fe79f9 (diff)
downloadtroggle-83d058221dae2d33548ecbceae42e11ec6ccb0e1.tar.gz
troggle-83d058221dae2d33548ecbceae42e11ec6ccb0e1.tar.bz2
troggle-83d058221dae2d33548ecbceae42e11ec6ccb0e1.zip
Fixed survex file list for one or more caves
Diffstat (limited to 'core/models/caves.py')
-rw-r--r--core/models/caves.py12
1 files changed, 4 insertions, 8 deletions
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 = {}