Protect the system from when one attempts to start a job without an inventory

This commit is contained in:
Matthew Jones
2015-01-08 14:55:58 -05:00
parent 80b2b36bf3
commit 0eaf2dc00c
3 changed files with 5 additions and 1 deletions

View File

@@ -102,7 +102,8 @@ def emit_update_inventory_on_created_or_deleted(sender, **kwargs):
except Inventory.DoesNotExist:
pass
else:
update_inventory_computed_fields.delay(inventory.id, True)
if inventory is not None:
update_inventory_computed_fields.delay(inventory.id, True)
def store_initial_active_state(sender, **kwargs):
instance = kwargs['instance']