Skip to content
This repository has been archived by the owner on Sep 12, 2022. It is now read-only.

Commit

Permalink
Amending PR after review
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-gregory committed May 24, 2017
1 parent b1eeb51 commit 0ddc641
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions api/v2/serializers/details/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def get_size(self, obj):
return serializer.data

def get_image(self, obj):
if not obj.source.is_machine():
if obj.source.is_volume():
return {}
image_uuid = obj.application_uuid()
image = Image.objects.get(uuid=image_uuid)
Expand All @@ -74,7 +74,7 @@ def get_ip_address(self, obj):
return obj.ip_address

def get_version(self, obj):
if not obj.source.is_machine():
if obj.source.is_volume():
return {}
version = obj.source.providermachine.application_version
serializer = ImageVersionSummarySerializer(
Expand Down
2 changes: 1 addition & 1 deletion core/models/allocation_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def time_remaining(self, user=None):
"The structure of settings.SPECIAL_ALLOCATION_SOURCES "
"has changed! Verify your settings are correct and/or "
"change the lines of code above.")
last_snapshot = self.user_allocation_snapshots.filter(user__username='test-sgregory').order_by('-updated').last()
last_snapshot = self.user_allocation_snapshots.get(user=user)

This comment has been minimized.

Copy link
@julianpistorius

julianpistorius Aug 2, 2017

Contributor

Note: This can fail, which can bubble up and cause monitor_allocation_sources Celery task to fail for everybody.

else:
compute_allowed = self.compute_allowed
last_snapshot = self.snapshot
Expand Down

0 comments on commit 0ddc641

Please sign in to comment.