Skip to content

Commit

Permalink
Allow underscores in slugs (apache#3951)
Browse files Browse the repository at this point in the history
* Allow underscores in slugs

* Switching regex to use shorter \w
  • Loading branch information
michellethomas committed May 23, 2018
1 parent e9e6fbe commit 0ba0248
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion superset/views/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ def pre_add(self, obj):
obj.slug = obj.slug.strip() or None
if obj.slug:
obj.slug = obj.slug.replace(' ', '-')
obj.slug = re.sub(r'[^a-zA-Z0-9\-]+', '', obj.slug)
obj.slug = re.sub(r'[^\w\-]+', '', obj.slug)
if g.user not in obj.owners:
obj.owners.append(g.user)
utils.validate_json(obj.json_metadata)
Expand Down

0 comments on commit 0ba0248

Please sign in to comment.