diff --git a/src/Handler/Course/Register.hs b/src/Handler/Course/Register.hs index 36a82ac97..dbaaac8df 100644 --- a/src/Handler/Course/Register.hs +++ b/src/Handler/Course/Register.hs @@ -224,6 +224,7 @@ postCRegisterR tid ssh csh = do examRegistrations <- E.select . E.from $ \(examRegistration `E.InnerJoin` exam) -> do E.on $ examRegistration E.^. ExamRegistrationExam E.==. exam E.^. ExamId E.where_ $ exam E.^. ExamCourse E.==. E.val cid + E.&&. examRegistration E.^. ExamRegistrationUser E.==. E.val uid return examRegistration forM_ examRegistrations $ \(Entity erId ExamRegistration{..}) -> do delete erId @@ -232,6 +233,7 @@ postCRegisterR tid ssh csh = do examResults <- E.select . E.from $ \(examResult `E.InnerJoin` exam) -> do E.on $ examResult E.^. ExamResultExam E.==. exam E.^. ExamId E.where_ $ exam E.^. ExamCourse E.==. E.val cid + E.&&. examResult E.^. ExamResultUser E.==. E.val uid return examResult forM_ examResults $ \(Entity erId ExamResult{..}) -> do delete erId