diff --git a/api/repositories/workflow_collaboration_repository.py b/api/repositories/workflow_collaboration_repository.py index ad8a0a7807..000f80496d 100644 --- a/api/repositories/workflow_collaboration_repository.py +++ b/api/repositories/workflow_collaboration_repository.py @@ -135,9 +135,7 @@ class WorkflowCollaborationRepository: return self._decode(raw) def set_leader_if_absent(self, workflow_id: str, sid: str) -> bool: - return bool( - self._redis.set(self.leader_key(workflow_id), sid, nx=True, ex=SESSION_STATE_TTL_SECONDS) - ) + return bool(self._redis.set(self.leader_key(workflow_id), sid, nx=True, ex=SESSION_STATE_TTL_SECONDS)) def set_leader(self, workflow_id: str, sid: str) -> None: self._redis.set(self.leader_key(workflow_id), sid, ex=SESSION_STATE_TTL_SECONDS) diff --git a/api/services/workflow_collaboration_service.py b/api/services/workflow_collaboration_service.py index badb1b0575..e739e879e1 100644 --- a/api/services/workflow_collaboration_service.py +++ b/api/services/workflow_collaboration_service.py @@ -63,9 +63,7 @@ class WorkflowCollaborationService: self.handle_leader_disconnect(workflow_id, sid) self.broadcast_online_users(workflow_id) - def relay_collaboration_event( - self, sid: str, data: Mapping[str, object] - ) -> tuple[dict[str, str], int]: + def relay_collaboration_event(self, sid: str, data: Mapping[str, object]) -> tuple[dict[str, str], int]: mapping = self._repository.get_sid_mapping(sid) if not mapping: return {"msg": "unauthorized"}, 401 diff --git a/api/tests/unit_tests/services/test_workflow_service.py b/api/tests/unit_tests/services/test_workflow_service.py index 28891dbed1..a8e70ce872 100644 --- a/api/tests/unit_tests/services/test_workflow_service.py +++ b/api/tests/unit_tests/services/test_workflow_service.py @@ -633,9 +633,7 @@ class TestWorkflowService: # ==================== Draft Workflow Variable Update Tests ==================== # These tests verify updating draft workflow environment/conversation variables - def test_update_draft_workflow_environment_variables_updates_workflow( - self, workflow_service, mock_db_session - ): + def test_update_draft_workflow_environment_variables_updates_workflow(self, workflow_service, mock_db_session): """Test update_draft_workflow_environment_variables updates draft fields.""" app = TestWorkflowAssociatedDataFactory.create_app_mock() account = TestWorkflowAssociatedDataFactory.create_account_mock() @@ -670,9 +668,7 @@ class TestWorkflowService: account=account, ) - def test_update_draft_workflow_conversation_variables_updates_workflow( - self, workflow_service, mock_db_session - ): + def test_update_draft_workflow_conversation_variables_updates_workflow(self, workflow_service, mock_db_session): """Test update_draft_workflow_conversation_variables updates draft fields.""" app = TestWorkflowAssociatedDataFactory.create_app_mock() account = TestWorkflowAssociatedDataFactory.create_account_mock()