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 creators of new groups as owners #9032

Merged
merged 1 commit into from
Nov 7, 2024
Merged

Add creators of new groups as owners #9032

merged 1 commit into from
Nov 7, 2024

Conversation

seanh
Copy link
Contributor

@seanh seanh commented Oct 18, 2024

Depends on #9029.

Comment on lines +129 to +131
self.db.add(
GroupMembership(user_id=creator.id, group_id=group.id, roles=["owner"])
)
Copy link
Contributor Author

@seanh seanh Oct 18, 2024

Choose a reason for hiding this comment

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

I don't know if there's any way to pass through the roles=["owners"] when appending the membership via the group.members relationship? So constructing the GroupMembership object directly instead.

Copy link
Member

@marcospri marcospri Oct 22, 2024

Choose a reason for hiding this comment

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

To be honest I prefer this style. I much more clear what's going on.

@seanh seanh marked this pull request as ready for review October 18, 2024 16:46
@seanh seanh changed the base branch from main to roles-model October 18, 2024 16:47
Base automatically changed from roles-model to main November 7, 2024 14:28
@seanh seanh merged commit ae19946 into main Nov 7, 2024
9 checks passed
@seanh seanh deleted the add-creators-as-owners branch November 7, 2024 14:44
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