chore: move dashboard screenshot standalone logic (#23003)

This commit is contained in:
Elizabeth Thompson
2023-02-15 14:35:08 -08:00
committed by GitHub
parent f6c304437a
commit 4ddf67fc14
12 changed files with 76 additions and 56 deletions

View File

@@ -22,7 +22,6 @@ from celery.utils.abstract import CallableTask
from flask.cli import with_appcontext
from superset.extensions import db
from superset.utils.urls import get_url_path
logger = logging.getLogger(__name__)
@@ -94,13 +93,7 @@ def compute_thumbnails(
action = "Processing"
msg = f'{action} {friendly_type} "{model}" ({i+1}/{count})'
click.secho(msg, fg="green")
if friendly_type == "chart":
url = get_url_path(
"Superset.slice", slice_id=model.id, standalone="true"
)
else:
url = get_url_path("Superset.dashboard", dashboard_id_or_slug=model.id)
func(url, model.digest, force=force)
func(None, model.id, force=force)
if not charts_only:
compute_generic_thumbnail(