Skip to content

Commit

Permalink
Changelog + lower log lever for AppIO api connector
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Dec 2, 2024
1 parent 4ed9a43 commit 3e2dac8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 3 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Changelog
2.8.4 (unreleased)
------------------

- Fix first available day result.
- Change the date validation order, if day is vacation, it is not possibile to book.
[folix-01]
- Lower log level for AppIO exceptions
[folix-01]


2.8.3 (2024-11-28)
------------------
Expand Down
12 changes: 5 additions & 7 deletions src/redturtle/prenotazioni/io_tools/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,17 @@ def send_message(
"""
# 0. validazione argomenti
if len(subject) < 10 or len(subject) > 120:
logger.error(
logger.warning(
"la lunghezza dell'oggetto del messaggio deve stare tra i 10 e i 120 caratteri"
)
return None
if len(body) < 80 or len(body) > 10000:
logger.error(
logger.warning(
"la lunghezza del contenuto del messaggio deve stare tra i 80 e i 10.000 caratteri"
)
return None
if due_date and not isinstance(due_date, datetime):
logger.error(
logger.warning(
"il campo con la data, se valorizzato, deve essere di tipo datetime"
)
return None
Expand Down Expand Up @@ -209,9 +209,7 @@ def get_profile(self, fiscal_code):
)

except Exception:
logger.exception(
"profile for user %s not found (generic error)", fiscal_code
)
logger.warning("profile for user %s not found (generic error)", fiscal_code)

return None

Expand All @@ -237,7 +235,7 @@ def is_service_activated(self, fiscal_code):
)

except Exception:
logger.exception(
logger.warning(
"subsctiprion not found for user %s (generic error)",
fiscal_code,
)

0 comments on commit 3e2dac8

Please sign in to comment.