Two hotfixes (#574)

* fix for dashboards created without slices

* [hotfix] check_ownership param needed for adding slice to dashboard
This commit is contained in:
George Ke 2016-06-07 11:07:25 -07:00 committed by Maxime Beauchemin
parent 0d800fa302
commit 24a68f5c48
2 changed files with 2 additions and 2 deletions

View File

@ -315,7 +315,7 @@ class Dashboard(Model, AuditMixinNullable):
'dashboard_title': self.dashboard_title,
'slug': self.slug,
'slices': [slc.data for slc in self.slices],
'position_json': json.loads(self.position_json),
'position_json': json.loads(self.position_json) if self.position_json else [],
}
return json.dumps(d)

View File

@ -508,7 +508,7 @@ class DashboardModelView(CaravelModelView, DeleteMixin): # noqa
obj.slug = re.sub(r'\W+', '', obj.slug)
def pre_update(self, obj):
check_ownership()
check_ownership(obj)
self.pre_add(obj)