mirror of
https://github.com/apache/superset.git
synced 2026-06-09 09:39:25 +00:00
Add dashboard creator as owner of the dashboard (#1166)
* Add dashboard creator as owner of the dashboard * Address comments.
This commit is contained in:
committed by
Maxime Beauchemin
parent
bc7d0ffad2
commit
b855e2f1a6
@@ -822,6 +822,8 @@ class DashboardModelView(CaravelModelView, DeleteMixin): # noqa
|
||||
if obj.slug:
|
||||
obj.slug = obj.slug.replace(" ", "-")
|
||||
obj.slug = re.sub(r'\W+', '', obj.slug)
|
||||
if g.user not in obj.owners:
|
||||
obj.owners.append(g.user)
|
||||
|
||||
def pre_update(self, obj):
|
||||
check_ownership(obj)
|
||||
|
||||
Reference in New Issue
Block a user