Skip to content

Commit

Permalink
Fix to validation
Browse files Browse the repository at this point in the history
  • Loading branch information
Maija Y committed Jul 17, 2024
1 parent 32f2533 commit 239dc8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/headless-lms/models/src/library/progressing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,9 @@ pub async fn add_manual_completions(
)
.await?;

if completion.grade > Some(5) || completion.grade < Some(0) {
if completion.grade.is_some()
&& (completion.grade > Some(5) || completion.grade < Some(0))
{
return Err(ModelError::new(
ModelErrorType::PreconditionFailed,
"Invalid grade".to_string(),
Expand Down

0 comments on commit 239dc8d

Please sign in to comment.