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

Magento uses 0 as a possible value for IDs. #61

Merged
merged 1 commit into from
Nov 5, 2014
Merged
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
4 changes: 3 additions & 1 deletion magentoerpconnect/unit/binder.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ def bind(self, external_id, binding_id):
context = self.session.context.copy()
context['connector_no_export'] = True
now_fmt = datetime.now().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
assert external_id and binding_id, (
# the external ID can be 0 on Magento! Prevent False values
# like False, None, or "", but not 0.
assert (external_id or external_id == 0) and binding_id, (
"external_id or binding_id missing, "
"got: %s, %s" % (external_id, binding_id)
)
Expand Down