Skip to content

Commit

Permalink
#91 Fixed 500 on POST /homework
Browse files Browse the repository at this point in the history
  • Loading branch information
vityaman committed Apr 30, 2024
1 parent f918acc commit c9de90b
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ data class Homework(
val deadlineMoment: OffsetDateTime,
) {
init {
val maxDeadline = OffsetDateTime.parse("4096-08-08T08:08:08+03:00")
expect(deadlineMoment.isBefore(maxDeadline)) {
append("Homework deadline must be before $maxDeadline")
}
expect(publicationMoment.plusMinutes(1).isBefore(deadlineMoment)) {
append("Homework must be published 1 minute before deadline")
}
Expand Down

0 comments on commit c9de90b

Please sign in to comment.