Skip to content

Commit

Permalink
fix: dashboard DAO small code improvement (#23348)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpgaspar authored Mar 13, 2023
1 parent f3055fc commit b99d38d
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 b99d38d

Please sign in to comment.