From 4224916917be340664ab68ae1b302b3ae2a27870 Mon Sep 17 00:00:00 2001 From: jasquat Date: Thu, 12 Jan 2023 10:48:42 -0500 Subject: [PATCH] remove several debug print statements --- .../src/spiffworkflow_backend/routes/user.py | 11 ++++------- .../services/authentication_service.py | 3 --- .../services/error_handling_service.py | 3 ++- .../spiffworkflow_backend/services/message_service.py | 1 - .../services/service_task_service.py | 5 +---- spiffworkflow-frontend/src/config.tsx | 4 ---- .../src/routes/JsonSchemaFormBuilder.tsx | 5 ----- .../src/routes/ProcessGroupList.tsx | 7 ------- .../carbon/BaseInputTemplate/BaseInputTemplate.tsx | 1 - 9 files changed, 7 insertions(+), 33 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/user.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/user.py index 4b2c696f..efe0c3de 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/user.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/user.py @@ -188,9 +188,9 @@ def set_new_access_token_in_cookie( if hasattr(tld, "new_id_token") and tld.new_id_token: response.set_cookie("id_token", tld.new_id_token) - if hasattr(tld, 'user_has_logged_out') and tld.user_has_logged_out: - response.set_cookie("id_token", '', max_age=0) - response.set_cookie("access_token", '', max_age=0) + if hasattr(tld, "user_has_logged_out") and tld.user_has_logged_out: + response.set_cookie("id_token", "", max_age=0) + response.set_cookie("access_token", "", max_age=0) _clear_auth_tokens_from_thread_local_data() @@ -259,13 +259,10 @@ def login_return(code: str, state: str, session_state: str) -> Optional[Response AuthenticationService.store_refresh_token( user_model.id, auth_token_object["refresh_token"] ) - redirect_url = ( - f"{state_redirect_url}" - ) + redirect_url = state_redirect_url tld = current_app.config["THREAD_LOCAL_DATA"] tld.new_access_token = auth_token_object["access_token"] tld.new_id_token = auth_token_object["id_token"] - print(f"REDIRECT_URL: {redirect_url}") return redirect(redirect_url) raise ApiError( diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/authentication_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/authentication_service.py index 275be19d..77082a92 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/authentication_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/authentication_service.py @@ -62,7 +62,6 @@ class AuthenticationService: def open_id_endpoint_for_name(cls, name: str) -> str: """All openid systems provide a mapping of static names to the full path of that endpoint.""" openid_config_url = f"{cls.server_url()}/.well-known/openid-configuration" - print(f"openid_config_url: {openid_config_url}") if name not in AuthenticationService.ENDPOINT_CACHE: response = requests.get(openid_config_url) AuthenticationService.ENDPOINT_CACHE = response.json() @@ -93,7 +92,6 @@ class AuthenticationService: @staticmethod def generate_state(redirect_url: str) -> bytes: """Generate_state.""" - print(f"REDIRECT_URL_HEY: {redirect_url}") state = base64.b64encode(bytes(str({"redirect_url": redirect_url}), "UTF-8")) return state @@ -102,7 +100,6 @@ class AuthenticationService: ) -> str: """Get_login_redirect_url.""" return_redirect_url = f"{self.get_backend_url()}{redirect_url}" - print(f"RETURN_REDIRECT_URL_ONE: {return_redirect_url}") login_redirect_url = ( self.open_id_endpoint_for_name("authorization_endpoint") + f"?state={state}&" diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/error_handling_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/error_handling_service.py index 1e8b38f2..ffdfd26a 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/error_handling_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/error_handling_service.py @@ -3,6 +3,7 @@ from typing import Any from typing import List from typing import Union +from flask import current_app from flask_bpmn.api.api_error import ApiError from flask_bpmn.models.db import db @@ -57,7 +58,7 @@ class ErrorHandlingService: ) except Exception as e: # hmm... what to do if a notification method fails. Probably log, at least - print(e) + current_app.logger.error(e) @staticmethod def hanle_sentry_notification(_error: ApiError, _recipients: List) -> None: diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/message_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/message_service.py index b3d1e831..b659b13e 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/message_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/message_service.py @@ -42,7 +42,6 @@ class MessageService: message_type="receive", status="ready" ).all() for message_instance_send in message_instances_send: - # print(f"message_instance_send.id: {message_instance_send.id}") # check again in case another background process picked up the message # while the previous one was running if message_instance_send.status != "ready": diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/service_task_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/service_task_service.py index 6fec8b79..674ad54d 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/service_task_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/service_task_service.py @@ -55,9 +55,6 @@ class ServiceTaskDelegate: f"{connector_proxy_url()}/v1/do/{name}", json=params ) - if proxied_response.status_code != 200: - print("got error from connector proxy") - parsed_response = json.loads(proxied_response.text) if "refreshed_token_set" not in parsed_response: @@ -86,7 +83,7 @@ class ServiceTaskService: parsed_response = json.loads(response.text) return parsed_response except Exception as e: - print(e) + current_app.logger.error(e) return [] @staticmethod diff --git a/spiffworkflow-frontend/src/config.tsx b/spiffworkflow-frontend/src/config.tsx index d8d30564..36e0ed4e 100644 --- a/spiffworkflow-frontend/src/config.tsx +++ b/spiffworkflow-frontend/src/config.tsx @@ -1,6 +1,4 @@ const { port, hostname } = window.location; -console.log('START'); -console.log('window.location', window.location); let hostAndPort = `api.${hostname}`; let protocol = 'https'; @@ -14,11 +12,9 @@ if (/^\d+\./.test(hostname) || hostname === 'localhost') { } let url = `${protocol}://${hostAndPort}/v1.0`; -console.log('OUR URL', url); if (process.env.REACT_APP_BACKEND_BASE_URL) { url = process.env.REACT_APP_BACKEND_BASE_URL; } -console.log('NO THIS ONE', url); export const BACKEND_BASE_URL = url; diff --git a/spiffworkflow-frontend/src/routes/JsonSchemaFormBuilder.tsx b/spiffworkflow-frontend/src/routes/JsonSchemaFormBuilder.tsx index d4a9c2b4..b180ed2a 100644 --- a/spiffworkflow-frontend/src/routes/JsonSchemaFormBuilder.tsx +++ b/spiffworkflow-frontend/src/routes/JsonSchemaFormBuilder.tsx @@ -73,11 +73,6 @@ export default function JsonSchemaFormBuilder() { }; const onFormFieldTitleChange = (newFormFieldTitle: string) => { - console.log('newFormFieldTitle', newFormFieldTitle); - console.log( - 'setFormFieldIdHasBeenUpdatedByUser', - formFieldIdHasBeenUpdatedByUser - ); if (!formFieldIdHasBeenUpdatedByUser) { setFormFieldId(underscorizeString(newFormFieldTitle)); } diff --git a/spiffworkflow-frontend/src/routes/ProcessGroupList.tsx b/spiffworkflow-frontend/src/routes/ProcessGroupList.tsx index 5ba8563a..7dee4f20 100644 --- a/spiffworkflow-frontend/src/routes/ProcessGroupList.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessGroupList.tsx @@ -42,12 +42,6 @@ export default function ProcessGroupList() { path: `/process-models?per_page=1000&recursive=true&include_parent_groups=true`, successCallback: processResultForProcessModels, }); - HttpService.makeCallToBackend({ - path: `/status`, - successCallback: (result: any) => { - console.log(result); - }, - }); }, [searchParams]); const processModelSearchArea = () => { @@ -69,7 +63,6 @@ export default function ProcessGroupList() { }; if (processModelAvailableItems) { - console.log('document.cookie', document.cookie); return ( <> diff --git a/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx b/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx index 9e71b921..aa1c6451 100644 --- a/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx +++ b/spiffworkflow-frontend/src/themes/carbon/BaseInputTemplate/BaseInputTemplate.tsx @@ -45,7 +45,6 @@ export default function BaseInputTemplate< // Note: since React 15.2.0 we can't forward unknown element attributes, so we // exclude the "options" and "schema" ones here. if (!id) { - console.log('No id for', props); throw new Error(`no id for props ${JSON.stringify(props)}`); } const inputProps = {