From 7d3d63db56d7cd516a5ce0d5d22ed680ebee1763 Mon Sep 17 00:00:00 2001 From: Jonas Linter <{email_address}> Date: Thu, 9 Oct 2025 10:54:33 +0200 Subject: [PATCH] Fixing some Linter mistakes --- src/alpine_bits_python/alpinebits_server.py | 12 ++++++++---- src/alpine_bits_python/api.py | 7 ++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/alpine_bits_python/alpinebits_server.py b/src/alpine_bits_python/alpinebits_server.py index f15a232..1843f68 100644 --- a/src/alpine_bits_python/alpinebits_server.py +++ b/src/alpine_bits_python/alpinebits_server.py @@ -344,7 +344,7 @@ class PingAction(AlpineBitsAction): # compare echo data with capabilities, create a dictionary containing the matching capabilities capabilities_dict = server_capabilities.get_capabilities_dict() - _LOGGER.info(f"Capabilities Dict: {capabilities_dict}") + _LOGGER.debug("Capabilities of Server: %s", capabilities_dict) matching_capabilities = {"versions": []} # Iterate through client's requested versions @@ -541,11 +541,15 @@ class ReadAction(AlpineBitsAction): ) # List of (Reservation, Customer) tuples _LOGGER.info( - f"Querying reservations and customers for hotel {hotelid} from database" + "Querying reservations and customers for hotel %s from database", + hotelid, ) for reservation, customer in reservation_customer_pairs: _LOGGER.info( - f"Reservation: {reservation.id}, Customer: {customer.given_name}" + "Retrieving reservation %s for customer %s %s", + reservation.id, + customer.given_name, + customer.surname, ) res_retrive_rs = create_res_retrieve_response(reservation_customer_pairs) @@ -562,7 +566,7 @@ class ReadAction(AlpineBitsAction): class NotifReportReadAction(AlpineBitsAction): - """Necessary for read action to follow specification. Clients need to report acknowledgements""" + """Necessary for read action to follow specification. Clients need to report acknowledgements.""" def __init__(self, config: dict = {}): self.name = AlpineBitsActionName.OTA_HOTEL_NOTIF_REPORT diff --git a/src/alpine_bits_python/api.py b/src/alpine_bits_python/api.py index d26bfa3..15a0c2e 100644 --- a/src/alpine_bits_python/api.py +++ b/src/alpine_bits_python/api.py @@ -426,7 +426,7 @@ async def process_wix_form_submission(request: Request, data: dict[str, Any], db submissionTime[:-1] ) # Remove Z and convert except Exception as e: - _LOGGER.error("Error parsing submissionTime: %s", e) + _LOGGER.exception("Error parsing submissionTime: %s", e) submissionTime = None reservation = ReservationData( @@ -529,17 +529,18 @@ async def handle_wix_form( request: Request, data: dict[str, Any], db_session=Depends(get_async_session) ): """Unified endpoint to handle Wix form submissions (test and production). + No authentication required for this endpoint. """ try: return await process_wix_form_submission(request, data, db_session) except Exception as e: - _LOGGER.error(f"Error in handle_wix_form: {e!s}") + _LOGGER.error("Error in handle_wix_form: %s", e) # log stacktrace import traceback traceback_str = traceback.format_exc() - _LOGGER.error(f"Stack trace for handle_wix_form: {traceback_str}") + _LOGGER.exception("Stack trace for handle_wix_form: %s", traceback_str) raise HTTPException(status_code=500, detail="Error processing Wix form data")