fix last errors

This commit is contained in:
nek0 2022-04-15 21:06:18 +02:00
parent bf0af54438
commit 600fb00c63
3 changed files with 9 additions and 9 deletions

View file

@ -10,7 +10,7 @@ import Control.Monad.Reader (asks)
import Types
import Model.Journal
import Control.Role (checkCapability)
import Util
journalShow
:: Maybe (Int, AuthMethod)

View file

@ -15,7 +15,7 @@ import Data.Maybe (fromMaybe, isJust)
import Types
import Model
import Control.Role (checkCapability)
import Util
productNew
:: Maybe (Int, AuthMethod)

View file

@ -9,7 +9,7 @@ import Opaleye
import Data.ByteString.Lazy (fromStrict)
import Data.Maybe (fromMaybe)
import Data.Maybe (fromMaybe, fromJust)
import Data.Profunctor.Product.Default (Default)
@ -21,7 +21,7 @@ import qualified Data.Text.Encoding as E
import Database.PostgreSQL.Simple
import Control.Monad (void)
import Control.Monad (void, filterM)
import Control.Monad.Reader (asks)
import Control.Monad.IO.Class (liftIO)
@ -111,8 +111,8 @@ sendAdminNotification
sendAdminNotification subject message = do
conn <- asks rsConnection
allUsers <- userDetailsSelectAll conn
admins <- mapM
(\uid -> checkCapability uid roleCanManageSettings. userDetailsId)
admins <- filterM
((`checkCapability` roleCanManageSettings) . userDetailsId)
allUsers
mapM_
(\ UserDetails{..} ->
@ -121,7 +121,7 @@ sendAdminNotification subject message = do
, mailTo =
[ Address
(Just userDetailsIdent)
userDetailsEmail
(fromJust userDetailsEmail)
]
, mailCc = []
, mailBcc =[]
@ -132,7 +132,7 @@ sendAdminNotification subject message = do
, partEncoding = None
, partDisposition = DefaultDisposition
, partHeaders = []
, partContent = PartContent (fromString $ E.encodeUtf8 message)
, partContent = PartContent (fromString $ T.unpack message)
}
]]
}