Cédric Krier pushed to branch branch/default at Tryton / Tryton
Commits:
013e449f by Cédric Krier at 2022-12-30T15:59:15+01:00
Fallback to full history file if date is not found in the 90 days
Closes #11976
- - - - -
1 changed file:
- modules/currency/ecb.py
Changes:
=====================================
modules/currency/ecb.py
=====================================
@@ -68,6 +68,9 @@
url = _URL_HIST
with urlopen(url, context=context) as response:
element = _find_time(response, date)
+ if element is None and url == _URL_90:
+ with urlopen(_URL_HIST, context=context) as response:
+ element = _find_time(response, date)
return _compute_rates(element, currency, date)
except HTTPError as e:
raise RatesNotAvailableError() from e
View it on Heptapod:
https://foss.heptapod.net/tryton/tryton/-/commit/013e449f797032521ca8f686d0f4d4c5c9acadc1
--
View it on Heptapod:
https://foss.heptapod.net/tryton/tryton/-/commit/013e449f797032521ca8f686d0f4d4c5c9acadc1
You're receiving this email because of your account on foss.heptapod.net.