diff --git a/efile_app/efile/static/js/review.js b/efile_app/efile/static/js/review.js index 18fca25..714c9ed 100644 --- a/efile_app/efile/static/js/review.js +++ b/efile_app/efile/static/js/review.js @@ -297,7 +297,7 @@ const APIHandlers = { UIUpdater.updatePaymentMethodsSection(caseData.selected_payment_account, caseData.selected_payment_account_name || "Your payment"); await window.queryFees(); } catch (ex) { - console.log(ex); + console.error(ex); UIUpdater.showAddNewPaymentMethod(); } } @@ -364,7 +364,6 @@ const UIUpdater = { }, updatePaymentMethodsSection(account, account_name) { - console.log(account); const container = Utils.getElement('paymentMethodsContainer'); let html = '
'; @@ -446,7 +445,7 @@ const FilingHandler = { const result = await this.processSubmission(userData, selectedPaymentMethod.getAttribute("value")); this.handleSubmissionResult(result); } catch (error) { - console.log("Error on submission: %o", error) + console.error("Error on submission: %o", error) Messages.showError(gettext("An unexpected error occurred. Please try again.")); this.setSubmissionState(false); } @@ -462,7 +461,7 @@ const FilingHandler = { const result = await this.processFees(userData, selectedPaymentMethod.getAttribute("value")); this.handleFeesResponse(result); } catch (error) { - console.log("Error on submission: %o", error) + console.error("Error on submission: %o", error) Messages.showError(gettext("An unexpected error occurred. Please try again.")); this.setFeesState(false); } diff --git a/efile_app/efile/templates/efile/options.html b/efile_app/efile/templates/efile/options.html index a407820..e237a61 100644 --- a/efile_app/efile/templates/efile/options.html +++ b/efile_app/efile/templates/efile/options.html @@ -92,11 +92,8 @@

{% translate "View past filings" %}

result.data && Object.keys(result.data).length > 0 ) { - console.log("existing: %o", result.data) //TODO(brycew): return more here to bring user directly to old session return true; - } else { - console.log("existing: %o", result.data) } return false; } @@ -112,8 +109,6 @@

{% translate "View past filings" %}

session_id: new_uuid, jurisdiction: `{{jurisdiction}}`, }); - - console.log("Saved data!") } catch (error) { console.warn('Error saving case data:', error); // Session storage fallback is already in place diff --git a/efile_app/efile/views/api_views.py b/efile_app/efile/views/api_views.py index 2f4f6ec..4e17ccc 100644 --- a/efile_app/efile/views/api_views.py +++ b/efile_app/efile/views/api_views.py @@ -115,16 +115,16 @@ def get(self, request): # Use the first available filing type to get components if filing_types_data and len(filing_types_data) > 0: filing_type_id = filing_types_data[0].get("value") or filing_types_data[0].get("code") - print(f"Using first available filing type: {filing_type_id}") + logger.info(f"Using first available filing type: {filing_type_id}") else: # Fallback to a common filing type ID filing_type_id = "78690" - print(f"Using fallback filing type: {filing_type_id}") + logger.info(f"Using fallback filing type: {filing_type_id}") else: filing_type_id = "78690" # Fallback - print(f"Failed to get filing types, using fallback: {filing_type_id}") + logger.info(f"Failed to get filing types, using fallback: {filing_type_id}") - print(f"Getting filing components for court: {court}, filing_type: {filing_type_id}") + logger.info(f"Getting filing components for court: {court}, filing_type: {filing_type_id}") # Build the Suffolk LIT Lab API URL path = f"/jurisdictions/{jurisdiction}/codes/courts/{court}/filing_types/{filing_type_id}/filing_components" @@ -137,17 +137,17 @@ def get(self, request): filing_data = response.json() return JsonResponse({"success": True, "data": filing_data}) else: - print(f"Suffolk API error: {response.status_code} - {response.text}") + logger.error(f"Suffolk API error: {response.status_code} - {response.text}") return JsonResponse( {"success": False, "error": f"Failed to fetch filing components: {response.status_code}"}, status=response.status_code, ) - except requests.RequestException as e: - print(f"Request error: {e}") + except requests.RequestException: + logger.exception("Request error") return JsonResponse({"success": False, "error": "Failed to connect to filing components API"}, status=503) - except Exception as e: - print(f"Error getting filing components: {e}") + except Exception: + logger.exception("Error getting filing components") return JsonResponse({"success": False, "error": "Server error occurred"}, status=500)