You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.
[2015-12-12 09:20:51,424: ERROR/Worker-5] Lookup for the following ASINs failed: B00GK7MFXC
[2015-12-12 09:20:51,426: ERROR/MainProcess] Task price_monitor.product_advertising_api.tasks.SynchronizeProductsTask[5d22c892-68e1-4858-b3e3-9540459b9e7f] raised unexpected: AttributeError("'NoneType' object has no attribute 'items'",)
Traceback (most recent call last):
File "/home/alex/projects/github/django-amazon-price-monitor/price_monitor/product_advertising_api/tasks.py", line 188, in run
for asin, amazon_data in ProductAdvertisingAPI().item_lookup(item_ids=list(products.keys())).items():
AttributeError: 'NoneType' object has no attribute 'items'
Well, the workflow does not break, only the exception is thrown. Synchronization of other products still works.
As adding in frontend is the first step and querying the amazon api the second (after the frontend already has reloaded - depends a little on how fast the server is but usually the api call isn't done upon frontend refresh) the user currently has no feedback if the addition failed.
We should think about a workflow that solves this issue. The state of the product in this case is:
>>> Product.objects.get(asin='B00GK7MFXC').status
0
>>> Product.objects.get(asin='B00GK7MFXC').date_last_synced is None
True
>>> Product.objects.get(asin='B00GK7MFXC').title is None
True
We could refactor this into a property. The frontend then somehow should be able to find out, that the product is broken.
But I don't where where we would put this in the frontend workflow.
I could imagine that after adding a product (or a list of products) we see a overlay waiting till the synchronization is done with the status (and the possibility to remove invalid ones?). Or the workflow stays the same but we have a kind of notification that the product addition failed.
If you try to synchronize a non-existent ASIN, the sync workflow breaks. E.g. B00GK7MFXC.
The text was updated successfully, but these errors were encountered: