-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add translated BookingExceedLimitException message
- Loading branch information
Showing
6 changed files
with
715 additions
and
693 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,22 @@ | ||
# -*- coding: utf-8 -*- | ||
from plone import api | ||
|
||
from redturtle.prenotazioni import _ | ||
|
||
|
||
class BookerException(Exception): | ||
pass | ||
|
||
|
||
class BookingsLimitExceded(BookerException): | ||
def __init__( | ||
self, message="Booking limit is exceed for the current user", *args, **kwargs | ||
): | ||
return super().__init__(message, *args, **kwargs) | ||
def __init__(self, bookings_folder=None, *args, **kwargs): | ||
return super().__init__( | ||
api.portal.translate( | ||
_( | ||
"bookings_limit_exceeded_exception", | ||
default="Booking limit({limit}) is exceed for the current user", | ||
) | ||
).format(limit=bookings_folder.max_bookings_allowed), | ||
*args, | ||
**kwargs | ||
) |
Oops, something went wrong.