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_r390945610
##########
File path: superset/views/dashboard/api.py
##########
@@ -88,12 +88,14 @@ 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"]:
- data["slug"] = data["slug"].strip()
- data["slug"] = data["slug"].replace(" ", "-")
- data["slug"] = re.sub(r"[^\w\-]+", "", data["slug"])
+ if "slug" in data:
+ data["slug"] = data.get("slug")
+ if data["slug"]:
Review comment:
not exactly, I need to make sure that:
- Exists a slug key?
- If the slug key exists does it have data?
- If the slug key exists and it has data, apply string tranformations
----------------------------------------------------------------
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]