From 3a962f81f60dca55e7a12a7d32ae42e4e6d5369a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0brahim=20Ercan?= Date: Wed, 27 Jan 2021 14:04:14 +0300 Subject: [PATCH] fix: session error fixed related to thumbnails. (#12760) * fix: session error fixed related to thumbnails. * compute_and_cache moved to session scope * lint fix done --- superset/tasks/thumbnails.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/superset/tasks/thumbnails.py b/superset/tasks/thumbnails.py index eeba415cc56..4ca4f2770e7 100644 --- a/superset/tasks/thumbnails.py +++ b/superset/tasks/thumbnails.py @@ -49,13 +49,13 @@ def cache_chart_thumbnail( user = security_manager.get_user_by_username( current_app.config["THUMBNAIL_SELENIUM_USER"], session=session ) - screenshot.compute_and_cache( - user=user, - cache=thumbnail_cache, - force=force, - window_size=window_size, - thumb_size=thumb_size, - ) + screenshot.compute_and_cache( + user=user, + cache=thumbnail_cache, + force=force, + window_size=window_size, + thumb_size=thumb_size, + ) return None @@ -73,6 +73,6 @@ def cache_dashboard_thumbnail( user = security_manager.get_user_by_username( current_app.config["THUMBNAIL_SELENIUM_USER"], session=session ) - screenshot.compute_and_cache( - user=user, cache=thumbnail_cache, force=force, thumb_size=thumb_size, - ) + screenshot.compute_and_cache( + user=user, cache=thumbnail_cache, force=force, thumb_size=thumb_size, + )