forked from expo/troggle
alias as separate error type
This commit is contained in:
parent
7785843597
commit
f9a7ba7927
@ -591,7 +591,7 @@ def GetCaveLookup():
|
||||
message = f" - Warning: same alias id '{id:3}' for two caves '{Gcavelookup[id]}' and '{cave}'. Removing this shorthand alias entirely."
|
||||
Gcavelookup.pop(id)
|
||||
print(message)
|
||||
DataIssue.objects.create(parser='caves', message=message)
|
||||
DataIssue.objects.create(parser='aliases', message=message)
|
||||
|
||||
global Gcavelookup
|
||||
if Gcavelookup:
|
||||
@ -600,6 +600,8 @@ def GetCaveLookup():
|
||||
global Gcave_count
|
||||
Gcave_count = defaultdict(int) # sets default value to int(0)
|
||||
|
||||
DataIssue.objects.filter(parser='aliases').delete()
|
||||
|
||||
for cave in Cave.objects.all():
|
||||
key = cave.official_name.lower()
|
||||
if key != "" and key != "unamed" and key != "unnamed":
|
||||
@ -762,7 +764,7 @@ def GetCaveLookup():
|
||||
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)
|
||||
DataIssue.objects.create(parser='caves', message=message)
|
||||
DataIssue.objects.create(parser='aliases', message=message)
|
||||
|
||||
addmore = {}
|
||||
for id in Gcavelookup:
|
||||
@ -772,19 +774,12 @@ def GetCaveLookup():
|
||||
Gcavelookup = {**addmore, **Gcavelookup}
|
||||
|
||||
addmore ={}
|
||||
# for id in Gcavelookup:
|
||||
# if not Gcavelookup[id]:
|
||||
# pass
|
||||
# elif Gcavelookup[id].kataster_number:
|
||||
# addmore[id] = Gcavelookup[id].kataster_number
|
||||
# elif Gcavelookup[id].unofficial_number:
|
||||
# addmore[id] = Gcavelookup[id].unofficial_number.lower()
|
||||
|
||||
for c in Gcave_count:
|
||||
if Gcave_count[c] > 1:
|
||||
message = f" ** Duplicate cave id count={Gcave_count[c]} id:'{Gcavelookup[c]}' cave __str__:'{c}'"
|
||||
print(message)
|
||||
DataIssue.objects.create(parser='caves', message=message)
|
||||
DataIssue.objects.create(parser='aliases', message=message)
|
||||
# logdataissues[Gcavelookup[c]]=message # pending troggle-wide issues logging system
|
||||
|
||||
return Gcavelookup
|
||||
|
Loading…
Reference in New Issue
Block a user