fix(authorship-statements): resolve exam-part to exam properly
This commit is contained in:
parent
0b5b2ae025
commit
3a2d031bb5
@ -75,10 +75,12 @@ getSheetAuthorshipStatement (Entity _ Sheet{..}) = withCompatibleBackend @SqlBac
|
|||||||
E.where_ $ course E.^. CourseId E.==. E.val sheetCourse
|
E.where_ $ course E.^. CourseId E.==. E.val sheetCourse
|
||||||
return school
|
return school
|
||||||
|
|
||||||
let examId = sheetAuthorshipStatementExam
|
let examId = fmap Right sheetAuthorshipStatementExam
|
||||||
<|> sheetType ^? _examPart . re _SqlKey
|
<|> fmap Left (sheetType ^? _examPart . re _SqlKey)
|
||||||
<|> sheetRequireExamRegistration
|
<|> fmap Right sheetRequireExamRegistration
|
||||||
exam <- lift $ traverse getJust examId
|
exam <- lift . for examId $ \case
|
||||||
|
Right e -> getJust e
|
||||||
|
Left epId -> getJust epId >>= getJust . examPartExam
|
||||||
|
|
||||||
let
|
let
|
||||||
examAuthorshipStatement' = exam >>= examAuthorshipStatement
|
examAuthorshipStatement' = exam >>= examAuthorshipStatement
|
||||||
|
|||||||
Reference in New Issue
Block a user