Skip to content

Commit

Permalink
hyperlinked creditallocation
Browse files Browse the repository at this point in the history
  • Loading branch information
scrungus committed Jul 23, 2024
1 parent 04a85ca commit 2a919d9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion coral_credits/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def to_representation(self, instance):
return representation


class CreditAllocation(serializers.ModelSerializer):
class CreditAllocationSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = models.CreditAllocation
fields = ["name", "created", "account", "start", "end"]
Expand Down
4 changes: 2 additions & 2 deletions coral_credits/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class CreditAllocationViewSet(viewsets.ModelViewSet):
queryset = models.CreditAllocation.objects.all()
serializer_class = serializers.CreditAllocation
serializer_class = serializers.CreditAllocationSerializer
# permission_classes = [permissions.IsAuthenticated]


Expand Down Expand Up @@ -97,7 +97,7 @@ def retrieve(self, request, pk=None):

# TODO(johngarbutt) look for any during the above allocations
all_allocations_query = models.CreditAllocation.objects.filter(account__pk=pk)
allocations = serializers.CreditAllocation(all_allocations_query, many=True)
allocations = serializers.CreditAllocationSerializer(all_allocations_query, many=True)

# TODO(johngarbutt) look for any during the above allocations
consumers_query = models.Consumer.objects.filter(account__pk=pk)
Expand Down
6 changes: 3 additions & 3 deletions tools/functional_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ echo "Adding allocation to resources:"
curl -s -X POST -H "$CONTENT_TYPE" -d \
"{
\"inventories\": {
\"$VCPU_ID\": 100,
\"$MEMORY_ID\": 24000,
\"$DISK_GB\": 5000
\"VCPU\": 100,
\"MEMORY_MB\": 24000,
\"DISK_GB\": 5000
}
}" \
http://$SITE:$PORT/allocations/$ALLOCATION_ID/resources/
Expand Down

0 comments on commit 2a919d9

Please sign in to comment.