diff --git a/ietf/meeting/models.py b/ietf/meeting/models.py index 8cf386abf29..8bfdefbd2be 100644 --- a/ietf/meeting/models.py +++ b/ietf/meeting/models.py @@ -1243,6 +1243,9 @@ def can_manage_materials(self, user): def is_material_submission_cutoff(self): return date_today(datetime.UTC) > self.meeting.get_submission_correction_date() + def is_past(self): + return timezone.now() > self.official_timeslotassignment().timeslot.end_time() + def joint_with_groups_acronyms(self): return [group.acronym for group in self.joint_with_groups.all()] diff --git a/ietf/meeting/views.py b/ietf/meeting/views.py index 913c8bd3021..adaeca11b2e 100644 --- a/ietf/meeting/views.py +++ b/ietf/meeting/views.py @@ -1931,7 +1931,11 @@ def api_get_session_materials(request, session_id=None): minutes = session.minutes() slides_actions = [] - if can_manage_session_materials(request.user, session.group, session) or not session.is_material_submission_cutoff(): + if ( + has_role(request.user, "Secretariat") + or (not session.is_material_submission_cutoff() and session.can_manage_materials(request.user)) + or not session.is_past() + ): slides_actions.append( { "label": "Upload slides", @@ -3546,6 +3550,12 @@ def upload_session_slides(request, session_id, num, name=None): "The materials cutoff for this session has passed. Contact the secretariat for further action.", ) + if session.is_past() and not can_manage: + permission_denied( + request, + "This meeting has already occurred. Contact a chair or the secretariat for further action.", + ) + session_number = None sessions = get_sessions(session.meeting.number, session.group.acronym) show_apply_to_all_checkbox = ( diff --git a/ietf/templates/meeting/session_details_panel.html b/ietf/templates/meeting/session_details_panel.html index 7c52ac0b4ab..62fda934705 100644 --- a/ietf/templates/meeting/session_details_panel.html +++ b/ietf/templates/meeting/session_details_panel.html @@ -185,7 +185,7 @@