chore(email): obey email/postal preference even if no pin password is set
This commit is contained in:
parent
242dd0b8d4
commit
bf466c688d
@ -72,11 +72,11 @@ userPrefersEmail = not . userPrefersLetter
|
|||||||
-- | result (True, Nothing) indicates that neither userEmail nor userPostAddress is known
|
-- | result (True, Nothing) indicates that neither userEmail nor userPostAddress is known
|
||||||
getPostalPreferenceAndAddress :: User -> (Bool, Maybe [Text])
|
getPostalPreferenceAndAddress :: User -> (Bool, Maybe [Text])
|
||||||
getPostalPreferenceAndAddress usr@User{..} =
|
getPostalPreferenceAndAddress usr@User{..} =
|
||||||
(((userPrefersPostal || isNothing userPinPassword) && postPossible) || emailImpossible, pa)
|
((userPrefersPostal && postPossible) || not emailPossible, pa)
|
||||||
where
|
-- (((userPrefersPostal || isNothing userPinPassword) && postPossible) || not emailPossible, pa) -- ignore email/post preference if no pinPassword is set
|
||||||
orgEmail = CI.original userEmail
|
where
|
||||||
emailImpossible = validEmail orgEmail
|
emailPossible = validEmail' userEmail
|
||||||
postPossible = isJust pa
|
postPossible = isJust pa
|
||||||
pa = getPostalAddress usr
|
pa = getPostalAddress usr
|
||||||
|
|
||||||
getPostalAddress :: User -> Maybe [Text]
|
getPostalAddress :: User -> Maybe [Text]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user