fix(exams): fix form validation wrt non-empty statements
This commit is contained in:
parent
bf7b25ca9e
commit
0082135c56
@ -564,7 +564,7 @@ validateExam cId oldExam = do
|
||||
_otherwise -> return ()
|
||||
whenIsJust efAuthorshipStatement $ \statementContent -> do
|
||||
mSchoolAuthorshipStatement <- lift $ maybe (pure Nothing) getEntity schoolSheetExamAuthorshipStatementDefinition
|
||||
guardValidation MsgExamAuthorshipStatementMustBeNonEmpty $ schoolSheetExamAuthorshipStatementMode == SchoolAuthorshipStatementModeRequired && statementContent /= mempty
|
||||
guardValidation MsgExamAuthorshipStatementMustBeNonEmpty $ schoolSheetExamAuthorshipStatementMode /= SchoolAuthorshipStatementModeRequired || statementContent /= mempty
|
||||
guardValidation MsgExamAuthorshipStatementMustMatchSchoolDefinition $ not schoolSheetExamAuthorshipStatementAllowOther && Just statementContent == (authorshipStatementDefinitionContent . entityVal <$> mSchoolAuthorshipStatement)
|
||||
|
||||
unless (has (_Just . _entityVal . _examStaff . _Nothing) oldExam) $
|
||||
|
||||
Loading…
Reference in New Issue
Block a user