Fixing some Linter mistakes

This commit is contained in:
Jonas Linter
2025-10-09 10:54:33 +02:00
parent b9adb8c7d9
commit 7d3d63db56
2 changed files with 12 additions and 7 deletions

View File

@@ -344,7 +344,7 @@ class PingAction(AlpineBitsAction):
# compare echo data with capabilities, create a dictionary containing the matching capabilities # compare echo data with capabilities, create a dictionary containing the matching capabilities
capabilities_dict = server_capabilities.get_capabilities_dict() 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": []} matching_capabilities = {"versions": []}
# Iterate through client's requested versions # Iterate through client's requested versions
@@ -541,11 +541,15 @@ class ReadAction(AlpineBitsAction):
) # List of (Reservation, Customer) tuples ) # List of (Reservation, Customer) tuples
_LOGGER.info( _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: for reservation, customer in reservation_customer_pairs:
_LOGGER.info( _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) res_retrive_rs = create_res_retrieve_response(reservation_customer_pairs)
@@ -562,7 +566,7 @@ class ReadAction(AlpineBitsAction):
class NotifReportReadAction(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 = {}): def __init__(self, config: dict = {}):
self.name = AlpineBitsActionName.OTA_HOTEL_NOTIF_REPORT self.name = AlpineBitsActionName.OTA_HOTEL_NOTIF_REPORT

View File

@@ -426,7 +426,7 @@ async def process_wix_form_submission(request: Request, data: dict[str, Any], db
submissionTime[:-1] submissionTime[:-1]
) # Remove Z and convert ) # Remove Z and convert
except Exception as e: except Exception as e:
_LOGGER.error("Error parsing submissionTime: %s", e) _LOGGER.exception("Error parsing submissionTime: %s", e)
submissionTime = None submissionTime = None
reservation = ReservationData( reservation = ReservationData(
@@ -529,17 +529,18 @@ async def handle_wix_form(
request: Request, data: dict[str, Any], db_session=Depends(get_async_session) request: Request, data: dict[str, Any], db_session=Depends(get_async_session)
): ):
"""Unified endpoint to handle Wix form submissions (test and production). """Unified endpoint to handle Wix form submissions (test and production).
No authentication required for this endpoint. No authentication required for this endpoint.
""" """
try: try:
return await process_wix_form_submission(request, data, db_session) return await process_wix_form_submission(request, data, db_session)
except Exception as e: 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 # log stacktrace
import traceback import traceback
traceback_str = traceback.format_exc() 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") raise HTTPException(status_code=500, detail="Error processing Wix form data")