Commit 34583835 authored by Lucas Ficheux's avatar Lucas Ficheux Committed by Vincent A

[sogecartenet] Moved file removal for iter_transactions

Moved the file removal before the loops so that the file
is always removed even if we do not exhaust the generator
returned by iter_history.

When the file wasn't removed you could get the same history
for two different accounts.
parent 9fcdb89a
......@@ -171,10 +171,10 @@ class SogecarteEntrepriseBrowser(SeleniumBrowser):
encoding='latin-1',
))
os.remove(file_path)
for tr in sorted_transactions(page.iter_history()):
if tr.date >= self.today and coming:
yield tr
elif tr.date < self.today and not coming:
yield tr
os.remove(file_path)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment