aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--moonv4/moon_manager/moon_manager/api/models.py4
-rw-r--r--moonv4/moon_manager/moon_manager/api/policies.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/moonv4/moon_manager/moon_manager/api/models.py b/moonv4/moon_manager/moon_manager/api/models.py
index 6cb81439..56695c17 100644
--- a/moonv4/moon_manager/moon_manager/api/models.py
+++ b/moonv4/moon_manager/moon_manager/api/models.py
@@ -18,7 +18,7 @@ class Models(object):
def get_models(self, ctx, args):
try:
- data = self.manager.get_models(user_id=ctx["user_id"], model_id=ctx["id"])
+ data = self.manager.get_models(user_id=ctx["user_id"], model_id=ctx.get("id"))
except Exception as e:
LOG.error(e, exc_info=True)
return {"result": False,
@@ -28,7 +28,7 @@ class Models(object):
def add_model(self, ctx, args):
try:
- data = self.manager.add_model(user_id=ctx["user_id"], model_id=ctx["id"], value=args)
+ data = self.manager.add_model(user_id=ctx["user_id"], model_id=ctx.get("id"), value=args)
except Exception as e:
LOG.error(e, exc_info=True)
return {"result": False,
diff --git a/moonv4/moon_manager/moon_manager/api/policies.py b/moonv4/moon_manager/moon_manager/api/policies.py
index 8b242478..88c762a4 100644
--- a/moonv4/moon_manager/moon_manager/api/policies.py
+++ b/moonv4/moon_manager/moon_manager/api/policies.py
@@ -18,7 +18,7 @@ class Policies(object):
def get_policies(self, ctx, args):
try:
- data = self.manager.get_policies(user_id=ctx["user_id"], policy_id=ctx["id"])
+ data = self.manager.get_policies(user_id=ctx["user_id"], policy_id=ctx.get("id"))
except Exception as e:
LOG.error(e, exc_info=True)
return {"result": False,
@@ -28,7 +28,7 @@ class Policies(object):
def add_policy(self, ctx, args):
try:
- data = self.manager.add_policy(user_id=ctx["user_id"], policy_id=ctx["id"], value=args)
+ data = self.manager.add_policy(user_id=ctx["user_id"], policy_id=ctx.get("id"), value=args)
except Exception as e:
LOG.error(e, exc_info=True)
return {"result": False,