From d60ef89bcaf79bcd1565f9948cefa12b91ee29b6 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 8 Jul 2018 10:31:41 +0200 Subject: [PATCH] Revert "Course Capacity is verified now, in CRegister Handler that also checks secret" This reverts commit 9fc50e8736f9db317fb99a2b325ca3707f6c0a69. --- src/Handler/Course.hs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/Handler/Course.hs b/src/Handler/Course.hs index b9c3446e5..4fb1e98b5 100644 --- a/src/Handler/Course.hs +++ b/src/Handler/Course.hs @@ -142,14 +142,7 @@ postCRegisterR tid csh = do addMessage "info" "Sie wurden abgemeldet." | codeOk -> do actTime <- liftIO $ getCurrentTime - regOk <- runDB $ do - reg <- count [CourseParticipantCourse ==. cid] - if NTop (Just $ fromIntegral reg) < NTop (courseCapacity course) - then -- current capacity has room - insertUnique $ CourseParticipant cid aid actTime - else do -- no space left - addMessageI "danger" MsgCourseNoCapacity - return Nothing + regOk <- runDB $ insertUnique $ CourseParticipant cid aid actTime when (isJust regOk) $ addMessage "success" "Erfolgreich angemeldet!" | otherwise -> addMessage "danger" "Falsches Kennwort!" (_other) -> return () -- TODO check this!