Adding owner(s) to dashboard makes them own underlying slices (#2610)

This commit is contained in:
Maxime Beauchemin 2017-04-14 15:38:06 -07:00 committed by GitHub
parent 15654a3082
commit f5216f6047
1 changed files with 3 additions and 0 deletions

View File

@ -453,6 +453,9 @@ class DashboardModelView(SupersetModelView, DeleteMixin): # noqa
obj.owners.append(g.user)
utils.validate_json(obj.json_metadata)
utils.validate_json(obj.position_json)
owners = [o for o in obj.owners]
for slc in obj.slices:
slc.owners = list(set(owners) | set(slc.owners))
def pre_update(self, obj):
check_ownership(obj)