whittlem / pycryptobot

Python Crypto Bot (PyCryptoBot)
Apache License 2.0
1.97k stars 738 forks source link

Websvc : AttributeError: 'str' object has no attribute 'to_short' #677

Closed wtc0der closed 1 year ago

wtc0der commented 2 years ago

Describe the bug websvc raise an Exeption when try to open a Binance Market

To Reproduce Steps to reproduce the behavior:

  1. Launch websvc.py
  2. On the browser, Click on 'Binance'
  3. Then click on one market (exemple : EGLDUSDT)
  4. Browser return "Internal server error" and console raise the Exception :

[2022-02-13 11:40:04,274] ERROR in app: Exception on /binance/EGLDUSDT [GET] Traceback (most recent call last): File "/home/antoine/Dev/pycryptobot/venv/lib/python3.8/site-packages/flask/app.py", line 2073, in wsgi_app response = self.full_dispatch_request() File "/home/antoine/Dev/pycryptobot/venv/lib/python3.8/site-packages/flask/app.py", line 1518, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/antoine/Dev/pycryptobot/venv/lib/python3.8/site-packages/flask/app.py", line 1516, in full_dispatch_request rv = self.dispatch_request() File "/home/antoine/Dev/pycryptobot/venv/lib/python3.8/site-packages/flask/app.py", line 1502, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args) File "/home/antoine/Dev/pycryptobot/websvc/app/__init__.py", line 32, in binance_market return Pages.technical_analysis('binance', market, '15m', '1h', '6h') File "/home/antoine/Dev/pycryptobot/websvc/app/pages/pages.py", line 298, in technical_analysis ta = TechnicalAnalysis(api.getHistoricalData(market, g1, None)) File "/home/antoine/Dev/pycryptobot/models/exchange/binance/api.py", line 971, in getHistoricalData {"symbol": market, "interval": granularity.to_short, "limit": 300}, AttributeError: 'str' object has no attribute 'to_short'

Expected behavior Should return the web page

Desktop (please complete the following information):