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
|
||||
getPostalPreferenceAndAddress :: User -> (Bool, Maybe [Text])
|
||||
getPostalPreferenceAndAddress usr@User{..} =
|
||||
(((userPrefersPostal || isNothing userPinPassword) && postPossible) || emailImpossible, pa)
|
||||
where
|
||||
orgEmail = CI.original userEmail
|
||||
emailImpossible = validEmail orgEmail
|
||||
postPossible = isJust pa
|
||||
((userPrefersPostal && postPossible) || not emailPossible, pa)
|
||||
-- (((userPrefersPostal || isNothing userPinPassword) && postPossible) || not emailPossible, pa) -- ignore email/post preference if no pinPassword is set
|
||||
where
|
||||
emailPossible = validEmail' userEmail
|
||||
postPossible = isJust pa
|
||||
pa = getPostalAddress usr
|
||||
|
||||
getPostalAddress :: User -> Maybe [Text]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user