Skip to content

Commit

Permalink
Merge pull request #61 from guewen/magento-id-0-issue48
Browse files Browse the repository at this point in the history
Magento uses 0 as a possible value for IDs.
  • Loading branch information
guewen committed Nov 5, 2014
2 parents 7b24016 + 0061b87 commit 7a2be43
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit 7a2be43

Please sign in to comment.