feat(Products): New API endpoints to update/add Product Opener products and images#1012
Merged
feat(Products): New API endpoints to update/add Product Opener products and images#1012
Conversation
TTalex
commented
Sep 23, 2025
| @action( | ||
| detail=False, methods=["PATCH", "POST"], url_path=r"off_update/(?P<code>.+)" | ||
| ) | ||
| def update_off_product(self, request: Request, code): |
Collaborator
Author
There was a problem hiding this comment.
Something tells me there should be a serializer somewhere here
TTalex
commented
Sep 23, 2025
TTalex
commented
Sep 23, 2025
| flavor=flavor, | ||
| version=APIVersion.v2, | ||
| environment=Environment.org, | ||
| environment=Environment[os.getenv("ENVIRONMENT")], |
Collaborator
Author
There was a problem hiding this comment.
Could be a different PR, but this is quite useful when testing with products in OFF staging.
TTalex
commented
Sep 23, 2025
| ) | ||
|
|
||
|
|
||
| def update_off_product( |
Collaborator
Author
There was a problem hiding this comment.
Called update, but can also create :)
Member
There was a problem hiding this comment.
renamed to create_or_update_product_in_off 😁
TTalex
commented
Sep 23, 2025
TTalex
commented
Sep 23, 2025
TTalex
commented
Sep 23, 2025
|
|
||
| form_data = {} | ||
|
|
||
| form_data["user_id"] = (None, settings.OFF_DEFAULT_USER) |
Collaborator
Author
There was a problem hiding this comment.
What if the setting isn't set ?
Collaborator
Author
|
Add a comment with the original user: (OpenPrices) username |
raphodn
reviewed
Sep 25, 2025
b247f29 to
712093e
Compare
712093e to
7f2b79f
Compare
7f2b79f to
a7ab8cf
Compare
raphodn
approved these changes
Oct 2, 2025
raphodn
added a commit
that referenced
this pull request
Oct 4, 2025
raphodn
added a commit
that referenced
this pull request
Oct 4, 2025
This was referenced Oct 7, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Backend part of PR feat(Experiment): Add product to product opener using prices information open-prices-frontend#1685 allowing Product Opener products addition from Open Prices
Uses two new settings: OFF_DEFAULT_USER & OFF_DEFAULT_PASSWORD, that should contain username and password of a "default" Open Prices user
The PR also uses two recently-added filters:
source_isnullon products, to find products added to the prices' database, but not existing on any Product Opener database : refactor(Products): API: new filter by source__isnull #1030price_idon proofs, in order to fetch the proof containing a specific price : refactor(Price Tags): API: new filter by price_id #1033