superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Fix slug function (#3876)
Date Thu, 16 Nov 2017 17:47:03 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new d9161fb  Fix slug function (#3876)
d9161fb is described below

commit d9161fb76a9481fb8cf88812be1b9b8f97a028f3
Author: Maxime Beauchemin <maximebeauchemin@gmail.com>
AuthorDate: Thu Nov 16 09:47:00 2017 -0800

    Fix slug function (#3876)
---
 superset/views/core.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/superset/views/core.py b/superset/views/core.py
index bebf17f..17f5151 100755
--- a/superset/views/core.py
+++ b/superset/views/core.py
@@ -515,7 +515,7 @@ class DashboardModelView(SupersetModelView, DeleteMixin):  # noqa
         obj.slug = obj.slug.strip() or None
         if obj.slug:
             obj.slug = obj.slug.replace(' ', '-')
-            obj.slug = re.sub(r'\W+', '', obj.slug)
+            obj.slug = re.sub(r'[^a-zA-Z0-9\-]+', '', obj.slug)
         if g.user not in obj.owners:
             obj.owners.append(g.user)
         utils.validate_json(obj.json_metadata)

-- 
To stop receiving notification emails like this one, please contact
['"commits@superset.apache.org" <commits@superset.apache.org>'].

Mime
View raw message