dpgaspar commented on a change in pull request #9279: [dashboard][api] Fix, PUT 
publish/draft to not clean slug and owners
URL: 
https://github.com/apache/incubator-superset/pull/9279#discussion_r391604137
 
 

 ##########
 File path: superset/views/dashboard/api.py
 ##########
 @@ -88,12 +88,12 @@ class BaseDashboardSchema(BaseOwnedSchema):
     @pre_load
     def pre_load(self, data):  # pylint: disable=no-self-use
         super().pre_load(data)
-        data["slug"] = data.get("slug")
-        data["owners"] = data.get("owners", [])
-        if data["slug"]:
+        if data.get("slug"):
             data["slug"] = data["slug"].strip()
             data["slug"] = data["slug"].replace(" ", "-")
             data["slug"] = re.sub(r"[^\w\-]+", "", data["slug"])
+        if "owners" in data:
+            data["owners"] = data.get("owners", [])
 
 Review comment:
   yes, it's better, changed it

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to