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

incorrect usage of for else causes guaranteed duplication of addresses #241

Open
aliomattux opened this issue Jul 30, 2015 · 1 comment
Open

Comments

@aliomattux
Copy link

I see this module has not bee updated in over a year but for what its worth,

in partner.py there is a for each loop that checks customer addresses for a match.
see link https://github.com/openlabs/magento_integration/blob/develop/partner.py#L230

Python for else does not work the way described in the method description. No matter the result the else statement will always be called, meaning that in every case a new address will be created. Why call break? Why not just return the address that matches

@sharoonthomas
Copy link

@aliomattux yep, you are absolutely right. Do you want to send a pull request for the ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants