Skip to content

Commit

Permalink
readable submission auth
Browse files Browse the repository at this point in the history
resolves #562
  • Loading branch information
Fred Lefévère-Laoide authored and Fred Lefévère-Laoide committed Dec 19, 2024
1 parent d353533 commit 6d1db45
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion taipy/gui_core/_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def scenario_refresh(self, scenario_id: t.Optional[str]):
self.broadcast_core_changed({"scenario": scenario_id or True})

def submission_status_callback(self, submission_id: t.Optional[str] = None, event: t.Optional[Event] = None):
if not submission_id or not is_readable(t.cast(SubmissionId, submission_id)):
if not submission_id:
return
submission = None
new_status: t.Optional[SubmissionStatus] = None
Expand Down
6 changes: 1 addition & 5 deletions tests/gui_core/test_context_is_readable.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,6 @@ def sub_cb():
assert found is True
mockget.reset_mock()

with patch("taipy.gui_core._context.is_readable", side_effect=mock_is_readable_false):
gui_core_context.submission_status_callback(a_submission.id)
mockget.assert_not_called()

def test_data_node_adapter(self):
with patch("taipy.gui_core._context.core_get", side_effect=mock_core_get):
gui_core_context = _GuiCoreContext(Mock())
Expand Down Expand Up @@ -384,7 +380,7 @@ def test_get_scenarios_for_owner(self):
mockget.reset_mock()

with patch("taipy.gui_core._context.is_readable", side_effect=mock_is_readable_false):
gui_core_context.submission_status_callback(a_scenario.id)
gui_core_context.get_scenarios_for_owner(a_scenario.id)
mockget.assert_not_called()

def test_update_data(self):
Expand Down

0 comments on commit 6d1db45

Please sign in to comment.