Skip to content

Commit

Permalink
Add dashboard creator as owner of the dashboard (#1166)
Browse files Browse the repository at this point in the history
* Add dashboard creator as owner of the dashboard

* Address comments.
  • Loading branch information
bkyryliuk authored and mistercrunch committed Sep 22, 2016
1 parent bc7d0ff commit b855e2f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions caravel/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,8 @@ def pre_add(self, obj):
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)
Expand Down

0 comments on commit b855e2f

Please sign in to comment.