diff --git a/Application.hs b/Application.hs index 266af7a..8c9e306 100644 --- a/Application.hs +++ b/Application.hs @@ -5,7 +5,7 @@ module Application , makeFoundation ) where -import Control.Concurrent (forkIO, threadDelay) +import Control.Concurrent (forkIO) import Control.Exception (catch) import Data.WebsiteContent import Import hiding (catch) diff --git a/Handler/BannedTags.hs b/Handler/BannedTags.hs deleted file mode 100644 index 3139e1d..0000000 --- a/Handler/BannedTags.hs +++ /dev/null @@ -1,39 +0,0 @@ -module Handler.BannedTags where - -import Data.Slug (unSlug, Slug) -import Data.Tag -import Import - -checkSlugs :: Monad m => Textarea -> m (Either Text [Slug]) -checkSlugs (Textarea t) = - return $ first tshow $ (mapM mkTag $ filter (not . null) $ lines $ filter (/= '\r') t) - -fromSlugs :: [Slug] -> Textarea -fromSlugs = Textarea . unlines . map unSlug - -getBannedTagsR :: Handler Html -getBannedTagsR = do - Entity _ user <- requireAuth - extra <- getExtra - when (unSlug (userHandle user) `notMember` adminUsers extra) - $ permissionDenied "You are not an administrator" - curr <- fmap (map (bannedTagTag . entityVal)) - $ runDB $ selectList [] [Asc BannedTagTag] - ((res, widget), enctype) <- runFormPost $ renderDivs - $ fmap (fromMaybe []) - $ aopt - (checkMMap checkSlugs fromSlugs textareaField) - "Banned tags (one per line)" $ Just (Just curr) - case res of - FormSuccess tags -> do - runDB $ do - deleteWhere ([] :: [Filter BannedTag]) - insertMany_ $ map BannedTag tags - setMessage "Tags updated" - redirect BannedTagsR - _ -> defaultLayout $ do - setTitle "Banned Tags" - $(widgetFile "banned-tags") - -putBannedTagsR :: Handler Html -putBannedTagsR = getBannedTagsR diff --git a/Stackage/Database/Cron.hs b/Stackage/Database/Cron.hs index 4788097..80fdf66 100644 --- a/Stackage/Database/Cron.hs +++ b/Stackage/Database/Cron.hs @@ -5,7 +5,6 @@ module Stackage.Database.Cron ) where import ClassyPrelude.Conduit -import Control.Concurrent (threadDelay) import Stackage.PackageIndex.Conduit import Database.Persist (Entity (Entity)) import Data.Char (isAlpha) diff --git a/stack.yaml b/stack.yaml index 55136c4..052062e 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-5.1 +resolver: lts-5.15 image: container: name: fpco/stackage-server