diff --git a/superset/views/core.py b/superset/views/core.py index a3b7d110b9799..bfd7353649106 100755 --- a/superset/views/core.py +++ b/superset/views/core.py @@ -1214,11 +1214,8 @@ def overwrite_slice(self, slc): @expose("/checkbox////", methods=['GET']) def checkbox(self, model_view, id_, attr, value): """endpoint for checking/unchecking any boolean in a sqla model""" - views = sys.modules[__name__] - model_view_cls = getattr(views, model_view) - model = model_view_cls.datamodel.obj - - obj = db.session.query(model).filter_by(id=id_).first() + Col = ConnectorRegistry.sources['table'].column_cls + obj = db.session.query(Col).filter_by(id=id_).first() if obj: setattr(obj, attr, value == 'true') db.session.commit()