AC-537 Even more updates following database changes.

This commit is contained in:
Chris Church
2013-10-29 15:00:51 -04:00
parent 0c98b7ed69
commit 6815905882
6 changed files with 57 additions and 235 deletions

View File

@@ -748,8 +748,6 @@ class InventorySourceUpdateView(GenericAPIView):
data = dict(
can_update=obj.can_update,
)
if obj.source:
data['passwords_needed_to_update'] = obj.source_passwords_needed
return Response(data)
def post(self, request, *args, **kwargs):
@@ -757,8 +755,7 @@ class InventorySourceUpdateView(GenericAPIView):
if obj.can_update:
inventory_update = obj.update(**request.DATA)
if not inventory_update:
data = dict(passwords_needed_to_update=obj.source_passwords_needed)
return Response(data, status=status.HTTP_400_BAD_REQUEST)
return Response({}, status=status.HTTP_400_BAD_REQUEST)
else:
headers = {'Location': inventory_update.get_absolute_url()}
return Response(status=status.HTTP_202_ACCEPTED, headers=headers)