manager: use proper widget for agenda minimal booking time (#75884) #133

Merged
vdeniaud merged 1 commits from wip/75884-manager-utiliser-widgets-TimeWid into main 2023-08-17 14:03:41 +02:00
3 changed files with 5 additions and 4 deletions

View File

@ -18,7 +18,7 @@ class Migration(migrations.Migration):
blank=True,
default=datetime.time(0, 0),
null=True,
help_text='Ex.: 08:00:00. If left empty, available events will be those that are later than the current time.',
help_text='If left empty, available events will be those that are later than the current time.',
verbose_name='Booking opening time',
),
),

View File

@ -284,9 +284,7 @@ class Agenda(models.Model):
minimal_booking_time = models.TimeField(
verbose_name=_('Booking opening time'),
default=datetime.time(0, 0, 0), # booking is possible starting and finishin at 00:00
help_text=_(
'Ex.: 08:00:00. If left empty, available events will be those that are later than the current time.'
),
help_text=_('If left empty, available events will be those that are later than the current time.'),
null=True,
blank=True,
)

View File

@ -145,6 +145,9 @@ class AgendaBookingDelaysForm(forms.ModelForm):
'maximal_booking_delay',
'minimal_booking_time',
]
widgets = {
'minimal_booking_time': widgets.TimeWidget,
}
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)