Closed dr-duplo closed 6 years ago
I just discovered that this line could be the cause.
https://github.com/WoLpH/mt940/blob/c8e094fdab81fa4435a681db3f7275b290d42199/mt940/models.py#L306
If I comment it out, the whole thing works again.
While that might work for this case, the strip is correct. The :26:
should be part of the timestamp so it does need to be stripped. In this case though... perhaps an lstrip('\n')
might be needed too
Hi guys,
I discovered a problem with the parsing method of the transaction model. Actually this error prevents me fetching transactions with fints. In the example below (obfuscated) the transaction details ":86:" contain an ISO timetamp which is unfortunately wrapped to the next line. The ":26:" is no tag, but the minutes of the ISO timestamp.
The parser raises an exception since it doesn't know the tag ":26:" (it doesn't exist either). The root cause (I guess) is the method used to extract the tags (models.py:333). Basically it searches for lines starting with ':XX:' which includes also not existing 'tags'.
It better way may be to search for known tags by listing them in the regex like:
r'^:(?P<full_tag>61|86|...|...):'
This still would lead to possible parsing errors for tags below 60, so maybe another parsing strategy is more appropriate.