-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexError: list index out of range #3
Comments
Hm do you always get that error when trying to import that specific part?
|
Are you using an anonymous or private TME API token? |
I believe private? I got it from here: |
Tested again and appears so, yes. |
Oh, I got an idea! What's your language and location set to? |
EN/CA |
Do you have your currency set to CAD by any chance? |
Yes |
Ah! That's the problem! TME only supports EUR, USD and GBP. If you still want pricing information for tme you can overwrite the currency for TME only by specifying |
I'll add a warning + actual fix for the error tomorrow. |
Got a simple fix for the error for now, but I'd really like to have a warning/interactive resolving as well, but that's going to require some more refactoring ... |
You'll get an error now, but no interactive resolving. Going to leave this open, because I'll probably still have to do the refactoring eventually ... |
Appears to be caused by TME not returning any data for a part, therefore index [0] doesn't exit? I don't get the error if the TME part exists.
$ inventree-part-import DRV8837DSGR
searching for DRV8837DSGR ...
Traceback (most recent call last):
....
packages/inventree_part_import/suppliers/supplier_tme.py", line 23, in search
tme_stock = self.tme_api.get_prices_and_stocks([tme_part["Symbol"]])[0]
IndexError: list index out of range```
The text was updated successfully, but these errors were encountered: