Skip to content

Commit

Permalink
fix: dashboard DAO small code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar committed Mar 13, 2023
1 parent a8d5cb8 commit 9f70a3e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions superset/dashboards/dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class DashboardDAO(BaseDAO):
model_cls = Dashboard
base_filter = DashboardAccessFilter

@staticmethod
def get_by_id_or_slug(id_or_slug: Union[int, str]) -> Dashboard:
@classmethod
def get_by_id_or_slug(cls, id_or_slug: Union[int, str]) -> Dashboard:
query = (
db.session.query(Dashboard)
.filter(id_or_slug_filter(id_or_slug))
Expand All @@ -50,7 +50,7 @@ def get_by_id_or_slug(id_or_slug: Union[int, str]) -> Dashboard:
.outerjoin(Dashboard.roles)
)
# Apply dashboard base filters
query = DashboardAccessFilter("id", SQLAInterface(Dashboard, db.session)).apply(
query = cls.base_filter("id", SQLAInterface(Dashboard, db.session)).apply(
query, None
)
dashboard = query.one_or_none()
Expand Down

0 comments on commit 9f70a3e

Please sign in to comment.