Merge pull request #121 from rooftopcellist/smart_inventory_revert

Inventory update endpoint now returns empty list
This commit is contained in:
Christian Adams
2017-07-31 14:30:10 -04:00
committed by GitHub

View File

@@ -2496,8 +2496,6 @@ class InventoryInventorySourcesUpdate(RetrieveAPIView):
def retrieve(self, request, *args, **kwargs):
inventory = self.get_object()
if inventory.kind =='smart':
return Response(dict(error=_("Smart Inventories cannot host dynamic inventory sources.")), status=status.HTTP_400_BAD_REQUEST)
update_data = []
for inventory_source in inventory.inventory_sources.exclude(source=''):
details = {'inventory_source': inventory_source.pk,
@@ -2510,8 +2508,6 @@ class InventoryInventorySourcesUpdate(RetrieveAPIView):
update_data = []
successes = 0
failures = 0
if inventory.kind =='smart':
return Response(dict(error=_("Inventory update cannot be completed with Smart Inventory.")), status=status.HTTP_400_BAD_REQUEST)
for inventory_source in inventory.inventory_sources.exclude(source=''):
details = {'inventory_source': inventory_source.pk, 'status': None}
can_update = inventory_source.can_update