Skip to content

Commit

Permalink
Fix grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
folix-01 committed Oct 13, 2023
1 parent eadb9d1 commit 26f874c
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions src/redturtle/prenotazioni/content/prenotazioni_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
from redturtle.prenotazioni import _
from redturtle.prenotazioni.browser.widget import WeekTableOverridesFieldWidget
from redturtle.prenotazioni.config import DEFAULT_VISIBLE_BOOKING_FIELDS
from redturtle.prenotazioni.content.validators import PauseValidator, checkOverrides
from redturtle.prenotazioni.content.validators import (
PauseValidator,
checkOverrides,
)

try:
from plone.app.dexterity import textindexer
Expand All @@ -42,7 +45,9 @@ def get_from_form(form, fieldname):
return value
return None

number_of_entry = request.form.get("form.widgets.{}.count".format(fieldname))
number_of_entry = request.form.get(
"form.widgets.{}.count".format(fieldname)
)
data = []
prefix = "form.widgets.{}".format(fieldname)
for counter in range(int(number_of_entry)):
Expand Down Expand Up @@ -82,7 +87,9 @@ class IWeekTableRow(model.Schema):
)

afternoon_start = schema.Choice(
title=_("afternoon_start_label", default="Start time in the afternoon"),
title=_(
"afternoon_start_label", default="Start time in the afternoon"
),
vocabulary="redturtle.prenotazioni.VocOreInizio",
required=False,
)
Expand Down Expand Up @@ -222,7 +229,9 @@ class IPrenotazioniFolder(model.Schema):
descriptionAgenda = RichText(
required=False,
title=_("Descrizione Agenda", default="Descrizione Agenda"),
description=_("Inserire il testo di presentazione dell'agenda corrente"),
description=_(
"Inserire il testo di presentazione dell'agenda corrente"
),
)

form.mode(descriptionAgenda="display")
Expand All @@ -237,7 +246,9 @@ class IPrenotazioniFolder(model.Schema):

directives.widget(visible_booking_fields=CheckBoxFieldWidget)
visible_booking_fields = schema.List(
title=_("label_visible_booking_fields", default="Visible booking fields"),
title=_(
"label_visible_booking_fields", default="Visible booking fields"
),
description=_(
"help_visible_booking_fields",
"User will not be able to add a booking unless those "
Expand All @@ -255,7 +266,9 @@ class IPrenotazioniFolder(model.Schema):

directives.widget(required_booking_fields=CheckBoxFieldWidget)
required_booking_fields = schema.List(
title=_("label_required_booking_fields", default="Required booking fields"),
title=_(
"label_required_booking_fields", default="Required booking fields"
),
description=_(
"help_required_booking_fields",
"User will not be able to add a booking unless those "
Expand Down Expand Up @@ -449,7 +462,7 @@ def get_options():
"If you do not provide this field, "
"not type selection will be available. "
"If the 'Hidden Type' flag is selected the type will only "
"be visible for the users with the 'Bookings Manager' permission",
"be available to users with the 'Bookings Manager' permission",
),
value_type=DictRow(schema=IBookingTypeRow),
)
Expand Down Expand Up @@ -507,10 +520,14 @@ def data_validation(data):
raise Invalid(_("You should set a start time for afternoon."))
if interval["morning_start"] and interval["morning_end"]:
if interval["morning_start"] > interval["morning_end"]:
raise Invalid(_("Morning start should not be greater than end."))
raise Invalid(
_("Morning start should not be greater than end.")
)
if interval["afternoon_start"] and interval["afternoon_end"]:
if interval["afternoon_start"] > interval["afternoon_end"]:
raise Invalid(_("Afternoon start should not be greater than end."))
raise Invalid(
_("Afternoon start should not be greater than end.")
)

# TODO: definire o descrivere quando avviee la notifica
# TODO: inserire qui la chiave IO ? o su un config in zope.conf/environment ?
Expand Down

0 comments on commit 26f874c

Please sign in to comment.