From 8a7ba17c817b003594c046a4745c984e82d99038 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sat, 16 Oct 2021 17:49:50 +0200 Subject: [PATCH] remove unwanted config options --- config.yaml | 2 +- src/Types/Settings.hs | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/config.yaml b/config.yaml index 66f8b30..a548777 100644 --- a/config.yaml +++ b/config.yaml @@ -8,5 +8,5 @@ listen_port: 8000 #max_connections_per_client: 10 currency: "meow" currency_fraction: 2 -block_registration: false +#block_registration: false sendmail_path: "/run/wrappers/bin/sendmail" diff --git a/src/Types/Settings.hs b/src/Types/Settings.hs index bf39357..d31d8e8 100644 --- a/src/Types/Settings.hs +++ b/src/Types/Settings.hs @@ -1,25 +1,21 @@ {-# LANGUAGE TypeFamilies #-} module Types.Settings where -import qualified Data.Text as T - import Classes data Settings = Settings - { settingsCurrency :: T.Text - , settingsDecimalPlaces :: Int - , settingsBlockRegistration :: Bool + { settingsBlockRegistration :: Bool } deriving (Show) instance ToDatabase Settings where - type InTuple Settings = (T.Text, Int, Bool) + type InTuple Settings = Bool - toDatabase (Settings currency places reg) = (currency, places, reg) + toDatabase (Settings reg) = reg instance FromDatabase Settings where - type OutTuple Settings = (T.Text, Int, Bool) + type OutTuple Settings = Bool - fromDatabase (currency, places, reg) = Settings currency places reg + fromDatabase reg = Settings reg