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

Default image function field in product #34

Merged
merged 1 commit into from
Jun 6, 2014
Merged

Default image function field in product #34

merged 1 commit into from
Jun 6, 2014

Conversation

prakashpp
Copy link
Collaborator

No description provided.

@prakashpp
Copy link
Collaborator Author

@sharoonthomas please review

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.11%) when pulling 606bb7b on prakashpp:develop into 2ad132a on openlabs:develop.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.11%) when pulling 3aabda1 on prakashpp:develop into 2ad132a on openlabs:develop.

def get_default_image(self, name):
"""Returns default product image if any.
"""
return self.image_sets and self.image_sets[0].image.id

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None should be the return value if it is not there:

>>> l = []
>>> l and l[0]
[]
>>> l[0].id if l else None
>>>

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.11%) when pulling 7219c7e on prakashpp:develop into 2ad132a on openlabs:develop.

sharoonthomas pushed a commit that referenced this pull request Jun 6, 2014
Default image function field in product
@sharoonthomas sharoonthomas merged commit 7b522fa into openlabs:develop Jun 6, 2014
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

Successfully merging this pull request may close these issues.

None yet

3 participants