Skip to content

Commit

Permalink
fix: Dashboad export loading indicator (#17613)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Dec 1, 2021
1 parent 78c5d9a commit 76cd7b0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion superset/dashboards/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,9 +722,9 @@ def export(self, **kwargs: Any) -> Response:
$ref: '#/components/responses/500'
"""
requested_ids = kwargs["rison"]
token = request.args.get("token")

if is_feature_enabled("VERSIONED_EXPORT"):
token = request.args.get("token")
timestamp = datetime.now().strftime("%Y%m%dT%H%M%S")
root = f"dashboard_export_{timestamp}"
filename = f"{root}.zip"
Expand Down Expand Up @@ -763,6 +763,8 @@ def export(self, **kwargs: Any) -> Response:
resp.headers["Content-Disposition"] = generate_download_headers("json")[
"Content-Disposition"
]
if token:
resp.set_cookie(token, "done", max_age=600)
return resp

@expose("/<pk>/thumbnail/<digest>/", methods=["GET"])
Expand Down

0 comments on commit 76cd7b0

Please sign in to comment.