Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ietf/meeting/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()]

Expand Down
12 changes: 11 additions & 1 deletion ietf/meeting/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 = (
Expand Down
2 changes: 1 addition & 1 deletion ietf/templates/meeting/session_details_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ <h3 class="mt-4">Slides</h3>
href="{% url 'ietf.meeting.views.upload_session_slides' session_id=session.pk num=session.meeting.number %}">
Upload new slides
</a>
{% elif request.user.is_authenticated and not session.is_material_submission_cutoff %}
{% elif request.user.is_authenticated and not session.is_past %}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be ...and not session.is_past and not session.is_material_submission_cutoff? I.e., is this going to undesirably start allowing submissions between the material submission cutoff and the end of the session?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was my understanding that the material submission cutoff was after the meeting, to lock down the content for proceedings and such. This was partly based on what I saw in the test cases. So is_past would be a tighter restriction. If my understanding was incorrect, this would need to change.

<a class="btn btn-primary proposeslides"
href="{% url 'ietf.meeting.views.upload_session_slides' session_id=session.pk num=session.meeting.number %}">
Propose slides
Expand Down
Loading