From bf059a132094e53c3ef956582b5e13517e9c133d Mon Sep 17 00:00:00 2001 From: Sarah Vaupel Date: Sat, 19 Jun 2021 10:20:50 +0200 Subject: [PATCH] fix(exams): remove deprecated/unnecessary form validation wrt. authship statements --- src/Handler/Exam/Form.hs | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/Handler/Exam/Form.hs b/src/Handler/Exam/Form.hs index ee463f11a..a8d88a206 100644 --- a/src/Handler/Exam/Form.hs +++ b/src/Handler/Exam/Form.hs @@ -555,14 +555,5 @@ validateExam cId oldExam = do warnValidation MsgExamModeSchoolDiscouraged . not $ evalExamModeDNF schoolExamDiscouragedModes efExamMode - case schoolSheetExamAuthorshipStatementMode of - SchoolAuthorshipStatementModeNone -> guardValidation MsgExamAuthorshipStatementMustBeEmpty $ is _Nothing efAuthorshipStatement - SchoolAuthorshipStatementModeRequired -> guardValidation MsgExamAuthorshipStatementMustBeNonEmpty $ is _Just efAuthorshipStatement - _otherwise -> return () - whenIsJust efAuthorshipStatement $ \statementContent -> do - mSchoolAuthorshipStatement <- lift $ maybe (pure Nothing) getEntity schoolSheetExamAuthorshipStatementDefinition - guardValidation MsgExamAuthorshipStatementMustBeNonEmpty $ schoolSheetExamAuthorshipStatementMode /= SchoolAuthorshipStatementModeRequired || statementContent /= mempty -- FIXME: form validation fails in required mode with non-empty school default - guardValidation MsgExamAuthorshipStatementMustMatchSchoolDefinition $ not schoolSheetExamAuthorshipStatementAllowOther && Just statementContent == (authorshipStatementDefinitionContent . entityVal <$> mSchoolAuthorshipStatement) - unless (has (_Just . _entityVal . _examStaff . _Nothing) oldExam) $ guardValidation MsgExamStaffRequired $ isn't _Nothing efStaff