Added validation of the duration in interim meeting requests, with settings for min and max duration in settings.
- Legacy-Id: 17591
This commit is contained in:
parent
5f57e59a2b
commit
5cecc0bee2
|
@ -240,6 +240,14 @@ class InterimSessionModelForm(forms.ModelForm):
|
|||
raise forms.ValidationError('Required field')
|
||||
return date
|
||||
|
||||
def clean_requested_duration(self):
|
||||
min_minutes = settings.INTERIM_SESSION_MINIMUM_MINUTES
|
||||
max_minutes = settings.INTERIM_SESSION_MAXIMUM_MINUTES
|
||||
duration = self.cleaned_data.get('requested_duration')
|
||||
if not duration or duration < datetime.timedelta(minutes=min_minutes) or duration > datetime.timedelta(minutes=max_minutes):
|
||||
raise forms.ValidationError('Provide a duration, %s-%smin.' % (min_minutes, max_minutes))
|
||||
return duration
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""NOTE: as the baseform of an inlineformset self.save(commit=True)
|
||||
never gets called"""
|
||||
|
|
|
@ -1888,7 +1888,7 @@ class InterimTests(TestCase):
|
|||
'session_set-0-id':meeting.session_set.first().id,
|
||||
'session_set-0-date':formset_initial['date'].strftime('%Y-%m-%d'),
|
||||
'session_set-0-time':new_time.strftime('%H:%M'),
|
||||
'session_set-0-requested_duration':formset_initial['requested_duration'],
|
||||
'session_set-0-requested_duration': '00:30',
|
||||
'session_set-0-remote_instructions':formset_initial['remote_instructions'],
|
||||
#'session_set-0-agenda':formset_initial['agenda'],
|
||||
'session_set-0-agenda_note':formset_initial['agenda_note'],
|
||||
|
|
|
@ -764,6 +764,8 @@ IDSUBMIT_ANNOUNCE_LIST_EMAIL = 'i-d-announce@ietf.org'
|
|||
# Interim Meeting Tool settings
|
||||
INTERIM_ANNOUNCE_FROM_EMAIL = 'IESG Secretary <iesg-secretary@ietf.org>'
|
||||
VIRTUAL_INTERIMS_REQUIRE_APPROVAL = True
|
||||
INTERIM_SESSION_MINIMUM_MINUTES = 30
|
||||
INTERIM_SESSION_MAXIMUM_MINUTES = 150
|
||||
|
||||
# Days from meeting to day of cut off dates on submit -- cutoff_time_utc is added to this
|
||||
IDSUBMIT_DEFAULT_CUTOFF_DAY_OFFSET_00 = 13
|
||||
|
|
Loading…
Reference in a new issue