9.0 fix admin.ch service changed

This commit is contained in:
Timka Piric
2019-04-22 17:12:39 +02:00
parent 4621445889
commit 5e6fe42ccc

View File

@@ -46,8 +46,8 @@ class CH_ADMINGetter(CurrencyGetterInterface):
def get_updated_currency(self, currency_array, main_currency,
max_delta_days):
"""Implementation of abstract method of Curreny_getter_interface"""
url = ('http://www.afd.admin.ch/publicdb/newdb/'
'mwst_kurse/wechselkurse.php')
url = ('http://www.pwebapps.ezv.admin.ch/apps/rates/rate/'
'getxml?activeSearchType=today')
# We do not want to update the main currency
if main_currency in currency_array:
currency_array.remove(main_currency)
@@ -58,7 +58,7 @@ class CH_ADMINGetter(CurrencyGetterInterface):
dom = etree.fromstring(rawfile)
_logger.debug("Admin.ch sent a valid XML file")
adminch_ns = {
'def': 'http://www.afd.admin.ch/publicdb/newdb/mwst_kurse'
'def': 'http://www.pwebapps.ezv.admin.ch/apps/rates'
}
rate_date = dom.xpath(
'/def:wechselkurse/def:datum/text()',