You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/07/15 16:42:47 UTC

[GitHub] [superset] michael-s-molina commented on a diff in pull request #20673: fix(explore): Fix chart standalone URL for report/thumbnail generation

michael-s-molina commented on code in PR #20673:
URL: https://github.com/apache/superset/pull/20673#discussion_r922077985


##########
superset/views/redirects.py:
##########
@@ -34,25 +34,40 @@ class R(BaseSupersetView):  # pylint: disable=invalid-name
     """used for short urls"""
 
     @staticmethod
-    def _validate_url(url: Optional[str] = None) -> bool:
-        if url and (
-            url.startswith("//superset/dashboard/")
-            or url.startswith("//superset/explore/")
-        ):
-            return True
-        return False
+    def _validate_explore_url(url: str) -> Optional[str]:
+        if url.startswith("//superset/explore/p/"):
+            return url
+
+        if url.startswith("//superset/explore"):
+            return "/" + url[10:]  # Remove /superset from old Explore URLs
+
+        if url.startswith("//explore"):
+            return url
+
+        return None
+
+    @staticmethod
+    def _validate_dashboard_url(url: str) -> Optional[str]:
+        if url.startswith("//superset/explore/"):

Review Comment:
   ```suggestion
           if url.startswith("//superset/dashboard/"):
   ```



-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org