mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix key error on permalink fetch for old permalinks (#20414)
(cherry picked from commit 12436e47c9)
This commit is contained in:
committed by
Michael S. Molina
parent
78c577b515
commit
128722085c
@@ -48,8 +48,13 @@ class GetExplorePermalinkCommand(BaseExplorePermalinkCommand):
|
||||
).run()
|
||||
if value:
|
||||
chart_id: Optional[int] = value.get("chartId")
|
||||
datasource_id: int = value["datasourceId"]
|
||||
datasource_type = DatasourceType(value["datasourceType"])
|
||||
# keep this backward compatible for old permalinks
|
||||
datasource_id: int = (
|
||||
value.get("datasourceId") or value.get("datasetId") or 0
|
||||
)
|
||||
datasource_type = DatasourceType(
|
||||
value.get("datasourceType", DatasourceType.TABLE)
|
||||
)
|
||||
check_chart_access(datasource_id, chart_id, self.actor, datasource_type)
|
||||
return value
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user