fix: call _fetch_item from _process_image for easier override #4280
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In
catalogue.Importer
, we have the_fetch_item
function as a practical override entry point.But instead of using it,
_process_image
is reimplementing the same logic directly in the function.I fixed it so that
_fetch_item
is used and I removed the now unnecessary lookup argument in_process_image
.With those changes, in
handle
L.41, thelookup_value
is retrieved but is only used to construct some error logs. I think we should change the text of the logs so as not to need to retrieve this value just for them, but I wanted to discuss about it first.(PS: I have been working using Oscar for more than 2 years now, building a marketplace from scratch. I finally have some times to give back to that awesome project by providing some fixes for issues I found along the way so I'll be pretty active in the following days!)