summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compass-deck/db/api/machine.py2
-rw-r--r--compass-tasks-base/db/api/machine.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/compass-deck/db/api/machine.py b/compass-deck/db/api/machine.py
index 7991ada..4222288 100644
--- a/compass-deck/db/api/machine.py
+++ b/compass-deck/db/api/machine.py
@@ -68,7 +68,7 @@ def _get_machine(machine_id, session=None, **kwargs):
@utils.input_validates(mac=utils.check_mac)
def _add_machine(mac, owner_id=None, session=None, **kwargs):
"""Add a machine."""
- if isinstance(owner_id, (int, long)):
+ if not owner_id or isinstance(owner_id, (int, long)):
return utils.add_db_object(
session, models.Machine,
True,
diff --git a/compass-tasks-base/db/api/machine.py b/compass-tasks-base/db/api/machine.py
index 7991ada..4222288 100644
--- a/compass-tasks-base/db/api/machine.py
+++ b/compass-tasks-base/db/api/machine.py
@@ -68,7 +68,7 @@ def _get_machine(machine_id, session=None, **kwargs):
@utils.input_validates(mac=utils.check_mac)
def _add_machine(mac, owner_id=None, session=None, **kwargs):
"""Add a machine."""
- if isinstance(owner_id, (int, long)):
+ if not owner_id or isinstance(owner_id, (int, long)):
return utils.add_db_object(
session, models.Machine,
True,