remove ticker.info no longer exist

This commit is contained in:
2023-03-24 11:57:00 +01:00
parent fdcf474bde
commit 4103d08e26
3 changed files with 9 additions and 7 deletions

View File

@@ -270,10 +270,7 @@ def actif_edit(request):
ticker = yf.Ticker(entry.symbole)
entry.cours = ticker.fast_info.get('lastPrice')
entry.devise = ticker.fast_info.get('currency')
entry.libelle = html.unescape(ticker.info.get('shortName'))
# raccourcir le libelle
entry.libelle = entry.libelle.replace('UCITS ','')
entry.libelle = entry.libelle.replace('World U','World')
entry.pc_allocation = 1.0
entry.valeur = round(float(entry.cours) * entry.parite * entry.nombre, 3)
entry.plus_value = round(entry.valeur - float(entry.pru * entry.nombre), 3)
@@ -289,10 +286,7 @@ def actif_edit(request):
ticker = yf.Ticker(entry.symbole)
entry.cours = ticker.fast_info.get('lastPrice')
entry.devise = ticker.fast_info.get('currency')
entry.libelle = html.unescape(ticker.info.get('shortName'))
# raccourcir le libelle
entry.libelle = entry.libelle.replace('UCITS ','')
entry.libelle = entry.libelle.replace('World U','World')
entry.valeur = round(float(entry.cours) * entry.parite * entry.nombre, 3)
entry.plus_value = round(entry.valeur - float(entry.pru * entry.nombre), 3)
entry.pc_plusvalue = round(entry.plus_value / entry.valeur * 100, 3)