fix(allocation): fix allocation-results notifications

This commit is contained in:
Gregor Kleen 2019-10-04 20:22:43 +02:00
parent dfbbf939e5
commit ed700a3429

View File

@ -179,9 +179,11 @@ dispatchNotificationAllocationResults nAllocation jRecipient = userMailT jRecipi
doParticipantResults <- E.selectExists . E.from $ \application ->
E.where_ $ application E.^. CourseApplicationAllocation E.==. E.just (E.val nAllocation)
E.&&. application E.^. CourseApplicationUser E.==. E.val jRecipient
participantResults' <- E.select . E.from $ \(participant `E.InnerJoin` course) -> do
E.on $ participant E.^. CourseParticipantCourse E.==. course E.^. CourseId
E.where_ $ participant E.^. CourseParticipantAllocated E.==. E.just (E.val nAllocation)
E.&&. participant E.^. CourseParticipantUser E.==. E.val jRecipient
return course
let participantResults = case participantResults' of
[] | doParticipantResults -> Just []