From 19b576e795ad5f057a3e85cf0833aa5665d2f6a8 Mon Sep 17 00:00:00 2001 From: fr33domlover Date: Tue, 24 May 2016 08:34:40 +0000 Subject: [PATCH] New sharer field: Creation time --- config/models | 5 +++-- src/Vervis/Handler/Person.hs | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/config/models b/config/models index 349a292..cd56a5d 100644 --- a/config/models +++ b/config/models @@ -17,8 +17,9 @@ ------------------------------------------------------------------------------- Sharer - ident ShrIdent - name Text Maybe + ident ShrIdent + name Text Maybe + created UTCTime default='now()' UniqueSharer ident diff --git a/src/Vervis/Handler/Person.hs b/src/Vervis/Handler/Person.hs index bc1de78..56e30b8 100644 --- a/src/Vervis/Handler/Person.hs +++ b/src/Vervis/Handler/Person.hs @@ -50,10 +50,12 @@ postPeopleR = do ((result, widget), enctype) <- runFormPost formPersonNew case result of FormSuccess pn -> do + now <- liftIO getCurrentTime runDB $ do let sharer = Sharer - { sharerIdent = text2shr $ uLogin pn - , sharerName = uName pn + { sharerIdent = text2shr $ uLogin pn + , sharerName = uName pn + , sharerCreated = now } sid <- insert sharer let person = Person