Revert "Course Capacity is verified now, in CRegister Handler that also checks secret"
This reverts commit 9fc50e8736.
This commit is contained in:
parent
8f9ddd1137
commit
d60ef89bca
@ -142,14 +142,7 @@ postCRegisterR tid csh = do
|
|||||||
addMessage "info" "Sie wurden abgemeldet."
|
addMessage "info" "Sie wurden abgemeldet."
|
||||||
| codeOk -> do
|
| codeOk -> do
|
||||||
actTime <- liftIO $ getCurrentTime
|
actTime <- liftIO $ getCurrentTime
|
||||||
regOk <- runDB $ do
|
regOk <- runDB $ insertUnique $ CourseParticipant cid aid actTime
|
||||||
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
|
|
||||||
when (isJust regOk) $ addMessage "success" "Erfolgreich angemeldet!"
|
when (isJust regOk) $ addMessage "success" "Erfolgreich angemeldet!"
|
||||||
| otherwise -> addMessage "danger" "Falsches Kennwort!"
|
| otherwise -> addMessage "danger" "Falsches Kennwort!"
|
||||||
(_other) -> return () -- TODO check this!
|
(_other) -> return () -- TODO check this!
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user