Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: booking_types retro-compatibility #113

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ Changelog
2.1.4 (unreleased)
------------------

- Compatibility with old code that use booking_types field in PrenotazioniFolder
[mamico]

- Extend the booking duration limit to 180 min.
[folix-01]

- Allow Bookings Manager to create, move the bookings and create the vacations.
[folix-01]

- Convert booking types to c.t.
[folix-01]

Expand Down
12 changes: 12 additions & 0 deletions src/redturtle/prenotazioni/content/prenotazioni_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,3 +727,15 @@ def get_booking_types(self) -> Generator[PrenotazioneType, None, None]:
return self.listFolderContents(
contentFilter={"portal_type": "PrenotazioneType"}
)

# BBB: compatibility with old code (booking_types was a List of IBookingTypeRow)
@property
def booking_types(self):
return [
{
"name": t.title,
"duration": t.duration,
"hidden": t.hidden,
}
for t in self.get_booking_types()
]
Loading