mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 00:17:13 +00:00
replace assert() with message logging
This commit is contained in:
@@ -213,7 +213,11 @@ class LoadingSurvex():
|
||||
expo = self.expos[year]
|
||||
else:
|
||||
expeditions = Expedition.objects.filter(year=year)
|
||||
assert len(expeditions) == 1
|
||||
if len(expeditions) != 1 :
|
||||
message = f"! More than one expedition in year {year} '{line}' ({survexblock}) {survexblock.survexfile.path}"
|
||||
print((self.insp+message))
|
||||
DataIssue.objects.create(parser='survexunits', message=message)
|
||||
|
||||
expo= expeditions[0]
|
||||
self.expos[year]= expo
|
||||
|
||||
@@ -411,7 +415,11 @@ class LoadingSurvex():
|
||||
letterx = "X"
|
||||
if len(wallet)<2:
|
||||
wallet = "0" + wallet
|
||||
assert (int(yr)>1960 and int(yr)<2039), "Wallet year out of bounds: %s" % yr
|
||||
if not (int(yr)>1960 and int(yr)<2039):
|
||||
message = " ! Wallet year out of bounds {yr} '{refscan}' {survexblock.survexfile.path}"
|
||||
print((self.insp+message))
|
||||
DataIssue.objects.create(parser='survex', message=message)
|
||||
|
||||
refscan = "%s#%s%s" % (yr, letterx, wallet)
|
||||
try:
|
||||
if int(wallet)>100:
|
||||
|
||||
Reference in New Issue
Block a user