Skip to content

Commit

Permalink
[hotfix] fixing checkboxes in Tables->Columns
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 26, 2017
1 parent 1f8e48b commit 59d5fcf
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions superset/views/core.py
Expand Up @@ -1214,11 +1214,8 @@ def overwrite_slice(self, slc):
@expose("/checkbox/<model_view>/<id_>/<attr>/<value>", 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()
Expand Down

0 comments on commit 59d5fcf

Please sign in to comment.