Add dashboard creator as owner of the dashboard (#1166)

* Add dashboard creator as owner of the dashboard

* Address comments.
This commit is contained in:
Bogdan
2016-09-22 08:17:27 -07:00
committed by Maxime Beauchemin
parent bc7d0ffad2
commit b855e2f1a6

View File

@@ -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)