manager: use proper widget for agenda minimal booking time (#75884)
gitea/chrono/pipeline/head This commit looks good Details

This commit is contained in:
Valentin Deniaud 2023-08-17 09:52:46 +02:00
parent e2d70795b1
commit 7859f0558e
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)