Skip to content

Commit

Permalink
per Fred
Browse files Browse the repository at this point in the history
  • Loading branch information
dinhlongviolin1 committed Mar 5, 2024
1 parent 24fa575 commit f721df5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions taipy/gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

import markdown as md_lib
import tzlocal
from flask import Blueprint, Flask, g, has_app_context, jsonify, request, send_file, send_from_directory
from flask import Blueprint, Flask, g, has_app_context, has_request_context, jsonify, request, send_file, send_from_directory
from werkzeug.utils import secure_filename

import __main__ # noqa: F401
Expand Down Expand Up @@ -1003,7 +1003,11 @@ def __send_var_list_update( # noqa C901
newvalue = newvalue.get()
if isinstance(newvalue, (dict, _MapDict)):
# Skip in taipy-gui, available in custom frontend
if request.cookies.get(_Server._RESOURCE_HANDLER_ARG, None) is None:
resource_handler_id = None
with contextlib.suppress(Exception):
if has_request_context():
resource_handler_id = request.cookies.get(_Server._RESOURCE_HANDLER_ARG, None)
if resource_handler_id is None:
continue # this var has no transformer
if isinstance(newvalue, float) and math.isnan(newvalue):
# do not let NaN go through json, it is not handle well (dies silently through websocket)
Expand Down

0 comments on commit f721df5

Please sign in to comment.