Skip to content

Add warnings if due dates can't be shifted when importing assignments - #1394

Merged
bnmnetp merged 1 commit into
RunestoneInteractive:mainfrom
oscarlevin:import-tz
Aug 19, 2026
Merged

Add warnings if due dates can't be shifted when importing assignments#1394
bnmnetp merged 1 commit into
RunestoneInteractive:mainfrom
oscarlevin:import-tz

Conversation

@oscarlevin

Copy link
Copy Markdown
Collaborator

Courtesy of my assistant, this makes importing assignments more robust: if a due date for an assignment cannot be shifted (for example because the course timezone is not supported), then the assignment is still imported, just not with a shifted due date.

CopilotAI lite review requested due to automatic review settings August 18, 2026 20:20

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes assignment importing more resilient by allowing imports to proceed even when due-date shifting fails (e.g., because a course timezone is invalid), and surfaces warnings so instructors know to review due dates.

Changes:

  • Update due-date shifting to return an optional warning instead of raising when a course timezone cannot be resolved.
  • Propagate duedate_warning / duedate_not_shifted through backend import APIs and into the assignment builder UI.
  • Add coverage for invalid-course-timezone behavior in the assignment sharing/import tests.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
test/components/rsptx/db/test_assignment_sharing.pyAdds test ensuring imports succeed and return a warning when timezone resolution fails.
components/rsptx/db/crud/assignment.pyImplements warning-returning due-date shifting and threads warning/count through import flows.
bases/rsptx/assignment_server_api/routers/instructor.pyAdds warning/count fields to instructor import API responses.
bases/rsptx/assignment_server_api/assignment_builder/src/types/assignmentSharing.tsExtends TS types to include duedate_warning and duedate_not_shifted.
bases/rsptx/assignment_server_api/assignment_builder/src/store/assignment/assignment.logic.api.tsDisplays informational toasts when due dates could not be adjusted.
bases/rsptx/assignment_server_api/assignment_builder/src/components/routes/AssignmentBuilder/components/importAssignment/ImportPreviewPanel.tsxShows an inline warning alert in the import preview when due date couldn’t be adjusted.
bases/rsptx/assignment_server_api/assignment_builder/src/components/routes/AssignmentBuilder/components/importAssignment/ImportAssignmentModal.spec.tsxUpdates preview mock to include duedate_warning.
bases/rsptx/admin_server_api/routers/instructor.pyIncludes warning/count details in admin “copy assignment(s)” responses/messages.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +71 to +75
{preview.duedate_warning ? (
<Alert variant="light" color="yellow" title="Due date not adjusted">
{preview.duedate_warning}
</Alert>
) : null}
@bnmnetp

Copy link
Copy Markdown
Member

@oscarlevin -- can you fix the lint issues, and then I'll work on getting this out ASAP.

@oscarlevin

Copy link
Copy Markdown
CollaboratorAuthor

Yes, although it will not happen until this evening when I'm home from my day job. :(

@bnmnetp

Copy link
Copy Markdown
Member

OK, I may just fix it on my end (easy enough) so I can get this out. Its creating some anxiety for the CSAwesome teachers.

@oscarlevin

Copy link
Copy Markdown
CollaboratorAuthor

Thanks, sorry I lost track of this yesterday. Busy time of year.

@bnmnetp
bnmnetp merged commit 384885a into RunestoneInteractive:mainAug 19, 2026
4 of 5 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@oscarlevin@bnmnetp