Skip to content

Commit

Permalink
Fix <Prenotazione>.get_booking_type method
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Nov 2, 2023
1 parent 592e4b3 commit ffb198f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/redturtle/prenotazioni/content/prenotazione.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,5 +298,5 @@ def canDeleteBooking(self):

def get_booking_type(self):
return {
i.title: i.title for i in self.getPrenotazioniFolder().get_booking_types()
i.title: i for i in self.getPrenotazioniFolder().get_booking_types()
}.get(self.booking_type, None)
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@
from redturtle.prenotazioni import logger
from redturtle.prenotazioni.content.booking_type import IBookingType
from redturtle.prenotazioni.content.prenotazione import IPrenotazione
from redturtle.prenotazioni.interfaces import (
ISerializeToPrenotazioneSearchableItem,
)
from redturtle.prenotazioni.interfaces import ISerializeToPrenotazioneSearchableItem


@implementer(ISerializeToJson)
Expand Down Expand Up @@ -52,9 +50,7 @@ def __call__(self, *args, **kwargs):
booking_expiration_date
and booking_date.date() != booking_expiration_date.date()
):
logger.warning(
"Booking date and expiration date are different, fixing"
)
logger.warning("Booking date and expiration date are different, fixing")
booking_date = booking_date.date()
booking_expiration_date = booking_expiration_date.replace(
booking_date.year, booking_date.month, booking_date.day
Expand All @@ -72,9 +68,7 @@ def __call__(self, *args, **kwargs):
"company": self.prenotazione.company,
"staff_notes": self.prenotazione.staff_notes,
"booking_date": json_compatible(booking_date),
"booking_expiration_date": json_compatible(
booking_expiration_date
),
"booking_expiration_date": json_compatible(booking_expiration_date),
"booking_status": status["review_state"],
"booking_status_label": translate(
status["review_state"], context=self.request
Expand All @@ -97,9 +91,7 @@ def __init__(self, prenotazione, request):

def __call__(self, *args, **kwargs):
wf_tool = api.portal.get_tool("portal_workflow")
status = wf_tool.getStatusOf(
"prenotazioni_workflow", self.prenotazione
)
status = wf_tool.getStatusOf("prenotazioni_workflow", self.prenotazione)
return {
"title": self.prenotazione.Title(),
"description": self.prenotazione.description,
Expand Down

0 comments on commit ffb198f

Please sign in to comment.