From 78e4369afb1f76c1a6a30580a2ae35273f495e43 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Wed, 3 Jul 2019 16:26:24 +0200 Subject: [PATCH] feat(exam): save registration timestamp --- models/exams | 1 + src/Handler/Exam.hs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/models/exams b/models/exams index 365862929..809ba3f1b 100644 --- a/models/exams +++ b/models/exams @@ -34,6 +34,7 @@ ExamRegistration exam ExamId user UserId occurrence ExamOccurrenceId Maybe + time UTCTime default=now() UniqueExamRegistration exam user ExamPartResult examPart ExamPartId diff --git a/src/Handler/Exam.hs b/src/Handler/Exam.hs index 001ba2dba..c93195d9b 100644 --- a/src/Handler/Exam.hs +++ b/src/Handler/Exam.hs @@ -815,7 +815,8 @@ postERegisterR tid ssh csh examn = do formResult btnResult $ \case BtnRegister -> do runDB $ do - insert_ $ ExamRegistration eId uid Nothing + now <- liftIO getCurrentTime + insert_ $ ExamRegistration eId uid Nothing now audit' $ TransactionExamRegister (unTermKey tid) (unSchoolKey ssh) csh examn userIdent addMessageI Success $ MsgExamRegisteredSuccess examn redirect $ CExamR tid ssh csh examn EShowR