forked from filipg/gonito
handle is_anonymous
This commit is contained in:
parent
92af354a88
commit
cf55550453
@ -175,7 +175,7 @@ instance YesodAuth App where
|
||||
, userName = Nothing
|
||||
, userIsAdmin = False
|
||||
, userLocalId = Nothing
|
||||
, userIsAnonymous = Just False
|
||||
, userIsAnonymous = False
|
||||
}
|
||||
|
||||
-- You can add other plugins like BrowserID, email or OAuth here
|
||||
|
@ -124,7 +124,7 @@ getSubmission repoId commit challengeId description chan = do
|
||||
submissionDescription=description,
|
||||
submissionStamp=time,
|
||||
submissionSubmitter=userId,
|
||||
submissionIsPublic=Just False }
|
||||
submissionIsPublic=False }
|
||||
|
||||
getOuts :: Channel -> Key Submission -> Handler ([Out])
|
||||
getOuts chan submissionId = do
|
||||
|
@ -107,7 +107,11 @@ getEvaluationMap s@(Entity submissionId submission) = do
|
||||
|
||||
|
||||
formatSubmitter :: User -> Text
|
||||
formatSubmitter user = case userName user of
|
||||
formatSubmitter user = if userIsAnonymous user
|
||||
then
|
||||
"[anonymised]"
|
||||
else
|
||||
case userName user of
|
||||
Just name -> name
|
||||
Nothing -> "[name not given]"
|
||||
|
||||
|
@ -5,7 +5,7 @@ User
|
||||
name Text Maybe
|
||||
isAdmin Bool default=False
|
||||
localId Text Maybe
|
||||
isAnonymous Bool Maybe
|
||||
isAnonymous Bool default=False
|
||||
deriving Typeable
|
||||
PublicKey
|
||||
user UserId
|
||||
@ -47,7 +47,7 @@ Submission
|
||||
description Text
|
||||
stamp UTCTime default=now()
|
||||
submitter UserId
|
||||
isPublic Bool Maybe
|
||||
isPublic Bool default=False
|
||||
UniqueSubmissionRepoCommitChallenge repo commit challenge
|
||||
Fork
|
||||
source SubmissionId
|
||||
|
Loading…
Reference in New Issue
Block a user