Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add legalhold status to user profile #1522

Merged
merged 6 commits into from
May 23, 2021
Merged

Add legalhold status to user profile #1522

merged 6 commits into from
May 23, 2021

Conversation

smatting
Copy link
Contributor

No description provided.

@smatting smatting changed the title Add legalhold status to user profile [skip ci] Add legalhold status to user profile [WIP] May 21, 2021
@fisx fisx marked this pull request as draft May 21, 2021 12:13
@smatting smatting force-pushed the SQSERVICES-461-lh-status branch 2 times, most recently from ade8e81 to c9ab0d4 Compare May 21, 2021 17:25
@fisx fisx force-pushed the SQSERVICES-461-lh-status branch 2 times, most recently from 6e8aa05 to 0bc516c Compare May 23, 2021 11:18
@fisx fisx force-pushed the SQSERVICES-461-lh-status branch from 0bc516c to 0e6f202 Compare May 23, 2021 13:39
@fisx fisx changed the title [skip ci] Add legalhold status to user profile [WIP] Add legalhold status to user profile May 23, 2021

instance ToSchema UserLegalHoldStatus where
declareNamedSchema = tweak . genericDeclareNamedSchema opts
schema =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, this stuff should go into a separate PR. Especially so since this patch and the patch that you actually wanted to work on are commutative.

@@ -1,5 +1,4 @@
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -Wno-orphans #-}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nice.

@@ -900,7 +901,7 @@ botGetSelfH bot = json <$> botGetSelf bot
botGetSelf :: BotId -> Handler Public.UserProfile
botGetSelf bot = do
p <- lift $ User.lookupUser NoPendingInvitations (botUserId bot)
maybe (throwStd userNotFound) (return . Public.publicProfile) p
maybe (throwStd userNotFound) (return . (`Public.publicProfile` UserLegalHoldNoConsent)) p
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is an interesting question: what should be the default for bots? (And not just the value here, also the corresp. behavior. Maybe bots also have a member record and we can just pull that here, and answer this question later?)

@fisx fisx marked this pull request as ready for review May 23, 2021 13:40
@fisx fisx merged commit a5fd7fb into develop May 23, 2021
@fisx fisx deleted the SQSERVICES-461-lh-status branch May 23, 2021 15:20
mdimjasevic pushed a commit that referenced this pull request May 25, 2021
* Add legalhold status to user profile

* Work around bug in test utils.

see https://wearezeta.atlassian.net/browse/SQSERVICES-471

Co-authored-by: Matthias Fischmann <mf@zerobuzz.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants