From b855e2f1a670458f5b2076fde2f9c4d3140e83d4 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 22 Sep 2016 08:17:27 -0700 Subject: [PATCH] Add dashboard creator as owner of the dashboard (#1166) * Add dashboard creator as owner of the dashboard * Address comments. --- caravel/views.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/caravel/views.py b/caravel/views.py index 061e719d58b..3aa87f70706 100755 --- a/caravel/views.py +++ b/caravel/views.py @@ -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)