suddjian commented on a change in pull request #13352:
URL: https://github.com/apache/superset/pull/13352#discussion_r583296281



##########
File path: superset/dashboards/dao.py
##########
@@ -38,6 +38,20 @@ class DashboardDAO(BaseDAO):
     model_cls = Dashboard
     base_filter = DashboardFilter
 
+    @staticmethod
+    def get_dashboard(id_or_slug: str) -> Dashboard:
+        query = db.session.query(Dashboard).filter(
+            Dashboard.id_or_slug_filter(id_or_slug)
+        )
+        # Apply dashboard base filters
+        query = DashboardFilter("id", SQLAInterface(Dashboard, 
db.session)).apply(
+            query, None
+        )
+        dashboard = query.one_or_none()
+        if not dashboard:

Review comment:
       this `if` doesn't trigger when I enter a bogus slug or id and I'm not 
sure why yet




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



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

Reply via email to