Uh oh!
There was an error while loading. Please reload this page.
Add warnings if due dates can't be shifted when importing assignments - #1394
Conversation
There was a problem hiding this comment.
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_shiftedthrough 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
| File | Description |
|---|---|
| test/components/rsptx/db/test_assignment_sharing.py | Adds test ensuring imports succeed and return a warning when timezone resolution fails. |
| components/rsptx/db/crud/assignment.py | Implements warning-returning due-date shifting and threads warning/count through import flows. |
| bases/rsptx/assignment_server_api/routers/instructor.py | Adds warning/count fields to instructor import API responses. |
| bases/rsptx/assignment_server_api/assignment_builder/src/types/assignmentSharing.ts | Extends TS types to include duedate_warning and duedate_not_shifted. |
| bases/rsptx/assignment_server_api/assignment_builder/src/store/assignment/assignment.logic.api.ts | Displays informational toasts when due dates could not be adjusted. |
| bases/rsptx/assignment_server_api/assignment_builder/src/components/routes/AssignmentBuilder/components/importAssignment/ImportPreviewPanel.tsx | Shows 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.tsx | Updates preview mock to include duedate_warning. |
| bases/rsptx/admin_server_api/routers/instructor.py | Includes 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.
| {preview.duedate_warning ? ( | ||
| <Alert variant="light" color="yellow" title="Due date not adjusted"> | ||
| {preview.duedate_warning} | ||
| </Alert> | ||
| ) : null} |
bnmnetp
commented
Aug 19, 2026
@oscarlevin -- can you fix the lint issues, and then I'll work on getting this out ASAP. |
oscarlevin
commented
Aug 19, 2026
Yes, although it will not happen until this evening when I'm home from my day job. :( |
bnmnetp
commented
Aug 19, 2026
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
commented
Aug 19, 2026
Thanks, sorry I lost track of this yesterday. Busy time of year. |
Uh oh!
There was an error while loading. Please reload this page.
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.