summaryrefslogtreecommitdiffstats
path: root/parsers/survex.py
diff options
context:
space:
mode:
Diffstat (limited to 'parsers/survex.py')
-rw-r--r--parsers/survex.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index ad6f27f..bcb4070 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -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: