Compare commits

..

No commits in common. "d2f1b079224152e165a8089d1731beabd123034d" and "cbcf23e316f6c2f410c15037648d3c19cc20847b" have entirely different histories.

4 changed files with 12 additions and 15 deletions

View File

@ -137,13 +137,6 @@ deleteExpiredEmails time = runQuery $ delete $ do
verification <- from $ table @DBEmailVerification
where_ $ verification ^. DBEmailVerificationExpires <=. val time
deleteOrphanedVerifications :: MonadDB m => m ()
deleteOrphanedVerifications = runQuery $ delete $ do
verification <- from $ table @DBEmailVerification
where_ $ (==. val (0 :: Int)) $ subSelectCount $ do
email <- from $ table @DBEmail
where_ $ email ^. DBEmailVid ==. just (verification ^. DBEmailVerificationId)
deleteUsersWithoutEmail :: MonadDB m => m ()
deleteUsersWithoutEmail = runQuery $ delete $ do
user <- from $ table @DBUser

View File

@ -19,11 +19,20 @@ import Datarekisteri.Core.Types
import Data.Aeson (ToJSON(..), FromJSON(..))
import Data.ByteArray (ByteArray, ByteArrayAccess)
import Data.Morpheus.App.Internal.Resolving (Resolver, LiftOperation)
import Data.Morpheus.Types (MonadError, GQLError)
import Data.Time (getCurrentTime)
import Data.Morpheus.Server.Types (SCALAR)
import Data.Morpheus.Types (GQLType, DecodeScalar(..), KIND, EncodeScalar(..),
ScalarValue(..), MonadError, GQLError)
import Data.Morpheus.Types.GQLScalar (scalarToJSON, scalarFromJSON)
import Data.Time (UTCTime, getCurrentTime, NominalDiffTime, addUTCTime, Day)
import Data.Time.Format.ISO8601 (iso8601Show, iso8601ParseM)
import qualified Data.Text as T
import Data.Char (isSpace)
import Database.Persist.Class (PersistField(..))
import Database.Persist.PersistValue (PersistValue(..))
import Database.Persist.Sql (PersistFieldSql(..), SqlBackend)
import Network.Mail.Mime (Mail, Address(..))
import Text.Email.Validate (EmailAddress, toByteString, validate, emailAddress)
import qualified "base64" Data.ByteString.Base64 as B64 (encodeBase64, decodeBase64)
import "cryptonite" Crypto.Random (MonadRandom(..))
forward :: Monad m => [a] -> m [Maybe a]

View File

@ -58,7 +58,6 @@ gcEmailsMain :: CLIM ()
gcEmailsMain = do
time <- currentTime
deleteExpiredEmails time
deleteOrphanedVerifications
gcApplicationsMain :: CLIM ()
gcApplicationsMain = do

View File

@ -204,9 +204,6 @@ instance Yesod DataIdClient where
--bg-colour: #ffffff;
--fg-colour: #181c22;
}
* {
box-sizing: border-box;
}
html {
font-family: "Fira Sans", sans-serif;
height: 100%;
@ -242,7 +239,7 @@ instance Yesod DataIdClient where
margin-bottom: 0.3em;
}
form {
max-width: min(30em,100%);
max-width: 20em;
}
summary > h2 {
display: inline-block;
@ -333,7 +330,6 @@ instance Yesod DataIdClient where
$doctype 5
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<title>#{pageTitle p}
^{pageHead p}
<body>