[WIP] fix user specified JSON metadata not updating dashboard on refresh (#7027)

This commit is contained in:
Tom Hunter
2019-03-14 14:20:22 -04:00
committed by Christine Chambers
parent 05be866117
commit cc58f0e661

View File

@@ -633,8 +633,9 @@ class DashboardModelView(SupersetModelView, DeleteMixin): # noqa
}
def pre_add(self, obj):
obj.slug = obj.slug.strip() or None
obj.slug = obj.slug or None
if obj.slug:
obj.slug = obj.slug.strip()
obj.slug = obj.slug.replace(' ', '-')
obj.slug = re.sub(r'[^\w\-]+', '', obj.slug)
if g.user not in obj.owners: