From 92af354a880b3691e0868c67308a4107fbffd430 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Sun, 14 Feb 2016 08:44:16 +0100 Subject: [PATCH] add new fields --- Foundation.hs | 1 + Handler/ShowChallenge.hs | 3 ++- config/models | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Foundation.hs b/Foundation.hs index fbf4738..c71b2f8 100644 --- a/Foundation.hs +++ b/Foundation.hs @@ -175,6 +175,7 @@ instance YesodAuth App where , userName = Nothing , userIsAdmin = False , userLocalId = Nothing + , userIsAnonymous = Just False } -- You can add other plugins like BrowserID, email or OAuth here diff --git a/Handler/ShowChallenge.hs b/Handler/ShowChallenge.hs index 816dafb..926e9b7 100644 --- a/Handler/ShowChallenge.hs +++ b/Handler/ShowChallenge.hs @@ -123,7 +123,8 @@ getSubmission repoId commit challengeId description chan = do submissionChallenge=challengeId, submissionDescription=description, submissionStamp=time, - submissionSubmitter=userId } + submissionSubmitter=userId, + submissionIsPublic=Just False } getOuts :: Channel -> Key Submission -> Handler ([Out]) getOuts chan submissionId = do diff --git a/config/models b/config/models index d52533d..a9190fa 100644 --- a/config/models +++ b/config/models @@ -3,8 +3,9 @@ User password Text Maybe UniqueUser ident name Text Maybe - isAdmin Bool default=True + isAdmin Bool default=False localId Text Maybe + isAnonymous Bool Maybe deriving Typeable PublicKey user UserId @@ -46,6 +47,7 @@ Submission description Text stamp UTCTime default=now() submitter UserId + isPublic Bool Maybe UniqueSubmissionRepoCommitChallenge repo commit challenge Fork source SubmissionId