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
|
||||
return school
|
||||
|
||||
let examId = sheetAuthorshipStatementExam
|
||||
<|> sheetType ^? _examPart . re _SqlKey
|
||||
<|> sheetRequireExamRegistration
|
||||
exam <- lift $ traverse getJust examId
|
||||
let examId = fmap Right sheetAuthorshipStatementExam
|
||||
<|> fmap Left (sheetType ^? _examPart . re _SqlKey)
|
||||
<|> fmap Right sheetRequireExamRegistration
|
||||
exam <- lift . for examId $ \case
|
||||
Right e -> getJust e
|
||||
Left epId -> getJust epId >>= getJust . examPartExam
|
||||
|
||||
let
|
||||
examAuthorshipStatement' = exam >>= examAuthorshipStatement
|
||||
|
||||
Loading…
Reference in New Issue
Block a user