Skip to content

Conversation

@stuartc-graphcore
Copy link

A few tweaks but the main area that needs work is
class CreditAllocationResourceViewSet(viewsets.ModelViewSet):

This crashes out for any query that should also return resource allocations for the given account. The code looks incomplete and appeated to be using the wrong account field for the search.

Also the allocation resource object was not functioning as a single REST object because the creation was done via the allocation object for multiple entries. Consequently a dumb client (such as TF Rest API) cannot create and manage individual resources. The change I made to make it operate with a single item patches this but it might be better to implement a new endpoint


# TODO(johngarbutt) look for any during the above allocations
consumers_query = models.Consumer.objects.filter(account__pk=pk)
consumers_query = models.Consumer.objects.filter(resource_provider_account__account__pk=pk)
Copy link
Contributor

Choose a reason for hiding this comment

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

This has never worked.

Creating and updating an object works - the data exist, but querying these data back again causes a 502.

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.

2 participants