Fix some warnings in Achievements
This commit is contained in:
parent
30ba1afcbd
commit
69dedeecbd
@ -11,7 +11,6 @@ import Handler.Shared
|
|||||||
|
|
||||||
import Handler.AchievementUtils
|
import Handler.AchievementUtils
|
||||||
|
|
||||||
import Data.Time.Clock
|
|
||||||
import Data.Time.LocalTime
|
import Data.Time.LocalTime
|
||||||
|
|
||||||
import Data.Text
|
import Data.Text
|
||||||
@ -103,7 +102,7 @@ $if canGiveUpWorkingOn
|
|||||||
|
|
||||||
getSubmissionForAchievementR :: SubmissionId -> WorkingOnId -> Handler Html
|
getSubmissionForAchievementR :: SubmissionId -> WorkingOnId -> Handler Html
|
||||||
getSubmissionForAchievementR submissionId workingOnId = do
|
getSubmissionForAchievementR submissionId workingOnId = do
|
||||||
(Entity userId user) <- requireAuth
|
(Entity userId _) <- requireAuth
|
||||||
submission <- runDB $ get404 submissionId
|
submission <- runDB $ get404 submissionId
|
||||||
workingOn <- runDB $ get404 workingOnId
|
workingOn <- runDB $ get404 workingOnId
|
||||||
if submissionSubmitter submission == userId && workingOnUser workingOn == userId
|
if submissionSubmitter submission == userId && workingOnUser workingOn == userId
|
||||||
@ -151,7 +150,7 @@ getStartWorkingOnR achievementId = do
|
|||||||
|
|
||||||
getGiveUpWorkingOnR :: AchievementId -> Handler Html
|
getGiveUpWorkingOnR :: AchievementId -> Handler Html
|
||||||
getGiveUpWorkingOnR achievementId = do
|
getGiveUpWorkingOnR achievementId = do
|
||||||
(Entity userId user) <- requireAuth
|
(Entity userId _) <- requireAuth
|
||||||
|
|
||||||
alreadyWorkingOn <- runDB $ selectList [WorkingOnUser ==. userId,
|
alreadyWorkingOn <- runDB $ selectList [WorkingOnUser ==. userId,
|
||||||
WorkingOnAchievement ==. achievementId,
|
WorkingOnAchievement ==. achievementId,
|
||||||
@ -171,11 +170,11 @@ getGiveUpWorkingOnR achievementId = do
|
|||||||
|
|
||||||
|
|
||||||
determineWhetherCanStartWorkingOn Nothing _ _ = False
|
determineWhetherCanStartWorkingOn Nothing _ _ = False
|
||||||
determineWhetherCanStartWorkingOn (Just (Entity userId user)) peopleWorkingOn maxWinners =
|
determineWhetherCanStartWorkingOn (Just (Entity userId _)) peopleWorkingOn maxWinners =
|
||||||
(Import.all (\e -> (userId /= entityKey e)) peopleWorkingOn) && (checkLimit peopleWorkingOn maxWinners)
|
(Import.all (\e -> (userId /= entityKey e)) peopleWorkingOn) && (checkLimit peopleWorkingOn maxWinners)
|
||||||
|
|
||||||
determineWhetherCanGiveUpWorkingOn Nothing _ = False
|
determineWhetherCanGiveUpWorkingOn Nothing _ = False
|
||||||
determineWhetherCanGiveUpWorkingOn (Just (Entity userId user)) peopleWorkingOn =
|
determineWhetherCanGiveUpWorkingOn (Just (Entity userId _)) peopleWorkingOn =
|
||||||
(Import.any (\e -> (userId == entityKey e)) peopleWorkingOn)
|
(Import.any (\e -> (userId == entityKey e)) peopleWorkingOn)
|
||||||
|
|
||||||
checkLimit _ Nothing = True
|
checkLimit _ Nothing = True
|
||||||
@ -230,7 +229,6 @@ getEditAchievementR achievementId = do
|
|||||||
postEditAchievementR :: AchievementId -> Handler Html
|
postEditAchievementR :: AchievementId -> Handler Html
|
||||||
postEditAchievementR achievementId = do
|
postEditAchievementR achievementId = do
|
||||||
tagsAvailableAsJSON <- runDB $ getAvailableTagsAsJSON
|
tagsAvailableAsJSON <- runDB $ getAvailableTagsAsJSON
|
||||||
achievement <- runDB $ get404 achievementId
|
|
||||||
((result, formWidget), formEnctype) <- runFormPost (achievementForm Nothing Nothing)
|
((result, formWidget), formEnctype) <- runFormPost (achievementForm Nothing Nothing)
|
||||||
mUser <- maybeAuth
|
mUser <- maybeAuth
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user