fix if ralph_id is None #9

Merged
merged 3 commits into from May 15, 2013

Conversation

Projects
None yet
2 participants
Contributor

wmatyskiewicz commented May 15, 2013

No description provided.

wmatyskiewicz referenced this pull request in allegro/ralph_pricing May 15, 2013

Merged

if ralph_id is None #19

@deshipu deshipu commented on an outdated diff May 15, 2013

src/ralph_assets/api_pricing.py
@@ -9,10 +9,11 @@
def get_assets():
"""Yields dicts describing all assets"""
- for asset in Asset.objects.all():
+ for asset in Asset.admin_objects_dc.all():
+ ralph_device = asset.device_info.ralph_device
yield {
'asset_id': asset.id,
@deshipu

deshipu May 15, 2013

Contributor

Indent error?

@deshipu deshipu commented on an outdated diff May 15, 2013

src/ralph_assets/api_pricing.py
yield {
'asset_id': asset.id,
- 'ralph_id': asset.device_info.ralph_device.id,
+ 'ralph_id': ralph_device.id if ralph_device else None,
@deshipu

deshipu May 15, 2013

Contributor

asset.device_info.ralph_device_id

@deshipu deshipu added a commit that referenced this pull request May 15, 2013

@deshipu deshipu Merge pull request #9 from wmatyskiewicz/api
fix if ralph_id is None
90601f3

@deshipu deshipu merged commit 90601f3 into allegro:master May 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment