mirror of
https://github.com/apache/superset.git
synced 2024-09-12 08:39:45 -04:00
Adding owner(s) to dashboard makes them own underlying slices (#2610)
This commit is contained in:
parent
15654a3082
commit
f5216f6047
@ -453,6 +453,9 @@ class DashboardModelView(SupersetModelView, DeleteMixin): # noqa
|
|||||||
obj.owners.append(g.user)
|
obj.owners.append(g.user)
|
||||||
utils.validate_json(obj.json_metadata)
|
utils.validate_json(obj.json_metadata)
|
||||||
utils.validate_json(obj.position_json)
|
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):
|
def pre_update(self, obj):
|
||||||
check_ownership(obj)
|
check_ownership(obj)
|
||||||
|
Loading…
Reference in New Issue
Block a user