AC-686 Fix permissions for inventory source to allow org admins and users with write permissions to update.

This commit is contained in:
Chris Church
2013-11-20 13:54:51 -05:00
parent 7fa9e3289b
commit 39ad6b0ad1
3 changed files with 103 additions and 1 deletions

View File

@@ -826,6 +826,7 @@ class InventorySourceUpdatesList(SubListAPIView):
class InventorySourceUpdateView(GenericAPIView):
model = InventorySource
is_job_start = True
new_in_14 = True
def get(self, request, *args, **kwargs):
@@ -838,7 +839,7 @@ class InventorySourceUpdateView(GenericAPIView):
def post(self, request, *args, **kwargs):
obj = self.get_object()
if obj.can_update:
inventory_update = obj.update(**request.DATA)
inventory_update = obj.update()
if not inventory_update:
return Response({}, status=status.HTTP_400_BAD_REQUEST)
else: