Skip to content
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

Fix compatibility issues between sync-afas-akeneo and akeneo_connector #13

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions akeneo_connector/akeneo_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,12 @@ def set_value(self, attribute: str, locale: str | None = None, scope: str | None
Returns:
None
"""
# Failsafes
# Ensure self.values is properly initialized
if self.values is None:
self.values = {}
self.updated_values = {}

# Further processing
if data is None:
return

Expand All @@ -315,6 +320,7 @@ def set_value(self, attribute: str, locale: str | None = None, scope: str | None
'data': data
})


def get(self, identifier: str | None = None, with_attribute_options: bool = False):
"""
Retrieves the product data.
Expand Down Expand Up @@ -365,7 +371,7 @@ def update(self):
bool: JSON response if successful, None otherwise.
"""
# Build the URL
url = self.connector.product_url.format(identifier=self.identifier)
url = self.connector.products_url

# Update the product
return self.connector.update(url, self.payload())
Expand Down