From 0082135c56b7fc0e5db3af6910f8365e12920c46 Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Fri, 11 Jun 2021 12:20:43 +0200 Subject: [PATCH] fix(exams): fix form validation wrt non-empty statements --- src/Handler/Exam/Form.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler/Exam/Form.hs b/src/Handler/Exam/Form.hs index 4391a7ed6..41c003cab 100644 --- a/src/Handler/Exam/Form.hs +++ b/src/Handler/Exam/Form.hs @@ -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) $