File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -240,6 +240,14 @@ def clean_date(self):
240240 raise forms .ValidationError ('Required field' )
241241 return date
242242
243+ def clean_requested_duration (self ):
244+ min_minutes = settings .INTERIM_SESSION_MINIMUM_MINUTES
245+ max_minutes = settings .INTERIM_SESSION_MAXIMUM_MINUTES
246+ duration = self .cleaned_data .get ('requested_duration' )
247+ if not duration or duration < datetime .timedelta (minutes = min_minutes ) or duration > datetime .timedelta (minutes = max_minutes ):
248+ raise forms .ValidationError ('Provide a duration, %s-%smin.' % (min_minutes , max_minutes ))
249+ return duration
250+
243251 def save (self , * args , ** kwargs ):
244252 """NOTE: as the baseform of an inlineformset self.save(commit=True)
245253 never gets called"""
Original file line number Diff line number Diff line change @@ -1888,7 +1888,7 @@ def test_interim_request_edit_no_notice(self):
18881888 'session_set-0-id' :meeting .session_set .first ().id ,
18891889 'session_set-0-date' :formset_initial ['date' ].strftime ('%Y-%m-%d' ),
18901890 'session_set-0-time' :new_time .strftime ('%H:%M' ),
1891- 'session_set-0-requested_duration' :formset_initial [ 'requested_duration' ] ,
1891+ 'session_set-0-requested_duration' : '00:30' ,
18921892 'session_set-0-remote_instructions' :formset_initial ['remote_instructions' ],
18931893 #'session_set-0-agenda':formset_initial['agenda'],
18941894 'session_set-0-agenda_note' :formset_initial ['agenda_note' ],
Original file line number Diff line number Diff line change @@ -764,6 +764,8 @@ def skip_unreadable_post(record):
764764# Interim Meeting Tool settings
765765INTERIM_ANNOUNCE_FROM_EMAIL = 'IESG Secretary <iesg-secretary@ietf.org>'
766766VIRTUAL_INTERIMS_REQUIRE_APPROVAL = True
767+ INTERIM_SESSION_MINIMUM_MINUTES = 30
768+ INTERIM_SESSION_MAXIMUM_MINUTES = 150
767769
768770# Days from meeting to day of cut off dates on submit -- cutoff_time_utc is added to this
769771IDSUBMIT_DEFAULT_CUTOFF_DAY_OFFSET_00 = 13
You can’t perform that action at this time.
0 commit comments