From 337454b646c71bc313714b849dec49b4d7459a4d Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 5 Apr 2017 19:00:49 +0000 Subject: [PATCH] [hotfix] slice with missing datasource related --- superset/models/core.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/models/core.py b/superset/models/core.py index f61b33a12fccc..f825508ce8e95 100644 --- a/superset/models/core.py +++ b/superset/models/core.py @@ -50,7 +50,8 @@ def set_related_perm(mapper, connection, target): # noqa src_class = target.cls_model id_ = target.datasource_id ds = db.session.query(src_class).filter_by(id=int(id_)).first() - target.perm = ds.perm + if ds: + target.perm = ds.perm class Url(Model, AuditMixinNullable):