Skip to content

Commit 39ad7bd

Browse files
committed
fixing issue with args and cancelling callbacks
1 parent 9491c7f commit 39ad7bd

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

dash/_callback_context.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,14 @@ def path(self):
288288
"""
289289
return _get_from_context("path", "")
290290

291+
@property
292+
@has_context
293+
def args(self):
294+
"""
295+
Query parameters of the callback request as a dictionary-like object.
296+
"""
297+
return _get_from_context("args", "")
298+
291299
@property
292300
@has_context
293301
def remote(self):

dash/dash.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
from ._get_app import with_app_context, with_app_context_factory
7171
from ._grouping import map_grouping, grouping_len, update_args_group
7272
from ._obsolete import ObsoleteChecker
73+
from ._callback_context import callback_context
7374

7475
from . import _pages
7576
from ._pages import (
@@ -1382,6 +1383,7 @@ def _initialize_context(self, body, adapter):
13821383
)
13831384
g.cookies = dict(adapter.get_cookies())
13841385
g.headers = dict(adapter.get_headers())
1386+
g.args = adapter.get_args()
13851387
g.path = adapter.get_full_path()
13861388
g.remote = adapter.get_remote_addr()
13871389
g.origin = adapter.get_origin()
@@ -1529,7 +1531,7 @@ def _setup_server(self):
15291531
manager=manager,
15301532
)
15311533
def cancel_call(*_):
1532-
job_ids = flask.request.args.getlist("cancelJob")
1534+
job_ids = callback_context.args.getlist("cancelJob")
15331535
executor = _callback.context_value.get().background_callback_manager
15341536
if job_ids:
15351537
for job_id in job_ids:

0 commit comments

Comments
 (0)