Skip to content

Conversation

@LennartSchmidtKern
Copy link
Contributor

@LennartSchmidtKern LennartSchmidtKern marked this pull request as ready for review November 4, 2025 14:36
def get_all_team_members_by_project(project_id: str) -> List[User]:
query = (
session.query(User)
.join(TeamMember, TeamMember.user_id == User.id)
Copy link
Member

Choose a reason for hiding this comment

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

i think we only want the user_id here so not needed to join with user or is this used for something else as well?

)


def get_by_conversation(conversation_id: str) -> List[ConversationGlobalShare]:
Copy link
Member

Choose a reason for hiding this comment

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

return type doesn't fit

Comment on lines +48 to +49
if with_commit:
session.commit()
Copy link
Member

Choose a reason for hiding this comment

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

general.flush_or_commit(with_commit)

session.commit()


def get_by_user(project_id: str, user_id: str) -> List[ConversationGlobalShare]:
Copy link
Member

Choose a reason for hiding this comment

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

return type


for share in existing_shares:
if share.shared_with not in shared_with_set:
session.delete(share)
Copy link
Member

@JWittmeyer JWittmeyer Nov 4, 2025

Choose a reason for hiding this comment

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

we usually dont use the session object directly for this

Comment on lines +136 to +147
shares = []

for user_id in shared_with_user_ids:
share = ConversationShare(
conversation_id=conversation_id,
shared_with=user_id,
shared_by=shared_by,
can_copy=can_copy,
)
general.add(share, with_commit=False)
shares.append(share)

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
shares = []
for user_id in shared_with_user_ids:
share = ConversationShare(
conversation_id=conversation_id,
shared_with=user_id,
shared_by=shared_by,
can_copy=can_copy,
)
general.add(share, with_commit=False)
shares.append(share)
general.add_all([ConversationShare(
conversation_id=conversation_id,
shared_with=user_id,
shared_by=shared_by,
can_copy=can_copy,
) for user_id in shared_with_user_ids, with_commit=True)

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.

3 participants