Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 568ced8

Browse files
committed
User now sees an error message when trying to paste an exercise with passed deadline
1 parent c104a3c commit 568ced8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/main/java/fi/helsinki/cs/tmc/cli/command/PasteCommand.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ public void run(CommandLine args, Io io) {
9191
CourseInfo courseinfo = CourseInfoIo.load(ctx.getWorkDir().getConfigFile());
9292
Exercise exercise = courseinfo.getExercise(exerciseName);
9393
URI uri = TmcUtil.sendPaste(ctx, exercise, message);
94+
if (uri == null && exercise.hasDeadlinePassed()) {
95+
io.println("Unable to send the paste."
96+
+ " The deadline for submitting this exercise has passed");
97+
return;
98+
}
9499
if (uri == null) {
95100
io.println("Unable to send the paste");
96101
return;

0 commit comments

Comments
 (0)