Bankimport: Force re-annotation for badly parsed files

This commit is contained in:
Raphael Michel
2017-05-30 18:43:53 +02:00
parent 43f4803da7
commit b2dfd8ab11
3 changed files with 10 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ def parse(data, hint):
raise HintMismatchError('Invalid hint')
if len(data[0]) != hint['cols']:
raise HintMismatchError('Wrong column count')
good_hint = False
for row in data:
resrow = {}
if None in row or len(row) != hint['cols']:
@@ -31,8 +32,10 @@ def parse(data, hint):
or len(resrow['reference']) == 0 or resrow['date'] == '':
# This is probably a headline or something other special.
continue
if resrow['reference'] or resrow['payer']:
good_hint = True
result.append(resrow)
return result
return result, good_hint
def get_rows_from_file(file):