Skip to content

Commit

Permalink
Merge pull request #245 from bcgov/release-v0.1.0
Browse files Browse the repository at this point in the history
Release v0.1.0.3
  • Loading branch information
kuanfandevops committed Apr 26, 2018
2 parents 20fc269 + 3dc6bb4 commit 5eeb40f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions backend/api/viewsets/Organization.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ def get_serializer_class(self):
else:
return self.serializer_classes['default']

def list(self, request):
"""
Returns a list of Fuel Suppliers
There are two types of organizations: Government and Fuel Suppliers
The function needs to separate the organizations based on type
"""
fuel_suppliers = Organization.objects.filter(
type=OrganizationType.objects.get(type="Part3FuelSupplier")) \
.order_by('id')

serializer = self.get_serializer(fuel_suppliers, many=True)
return Response(serializer.data)

@detail_route(methods=['put'])
def delete(self, request, pk=None):
"""Destroys the specified organization"""
Expand Down

0 comments on commit 5eeb40f

Please sign in to comment.