fix too long name Vanguard etf

This commit is contained in:
2020-02-08 07:08:02 +01:00
parent 8fa45a59fe
commit 446ed1f04f
2 changed files with 4 additions and 2 deletions

View File

@@ -87,7 +87,7 @@
</div> </div>
<footer class="container-fluid bg-footer text-center"> <footer class="container-fluid bg-footer text-center">
<p>&copy; 2017&nbsp;-&nbsp;www.caotek.fr&nbsp;-&nbsp;Powered by <a href="https://trypyramid.com/">Pyramid 1.7.3</a></p> <p>&copy; 2017&nbsp;-&nbsp;www.caotek.fr&nbsp;-&nbsp;Powered by <a href="https://trypyramid.com/">Pyramid</a></p>
</footer> </footer>
<div metal:define-slot="additional_scripts" /> <div metal:define-slot="additional_scripts" />

View File

@@ -80,7 +80,9 @@ def actif_edit(request):
ticker = yf.Ticker(symbole) ticker = yf.Ticker(symbole)
new_values['cours'] = ticker.info.get('regularMarketPrice') new_values['cours'] = ticker.info.get('regularMarketPrice')
new_values['devise'] = ticker.info.get('currency') new_values['devise'] = ticker.info.get('currency')
new_values['libelle'] = html.unescape(ticker.info.get('longName')).replace('Distributing','').replace('Amundi Index Solutions - ','') longName = html.unescape(ticker.info.get('longName'))
import pdb;pdb.set_trace()
new_values['libelle'] = longName.replace('Vanguard Funds Public Limited Company - ','').replace('Amundi Index Solutions - ','')
update_actif(request, no_id, new_values) update_actif(request, no_id, new_values)
request.session.flash(u"La fiche a été mise à jour avec succès.", 'success') request.session.flash(u"La fiche a été mise à jour avec succès.", 'success')
return HTTPFound(location=request.route_url('home')) return HTTPFound(location=request.route_url('home'))