mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 19:00:56 +00:00
Fixed survex file list for one or more caves
This commit is contained in:
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user