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

chore(org member invite): changes to organization member to support organization member invite changes #88867

Merged
merged 6 commits into from
Apr 7, 2025

Conversation

mifu67
Copy link
Contributor

@mifu67 mifu67 commented Apr 4, 2025

  • Prevent saving an existing OrganizationMember object if it's associated with an OrganizationMemberInvite object
  • Prevent serializing OrganizationMember objects that are associated with OrganizationMemberInvite objects

@mifu67 mifu67 requested a review from cathteng April 4, 2025 23:32
@mifu67 mifu67 requested a review from a team as a code owner April 4, 2025 23:32
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Apr 4, 2025
Copy link

codecov bot commented Apr 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #88867    +/-   ##
========================================
  Coverage   87.73%   87.73%            
========================================
  Files       10072    10077     +5     
  Lines      569659   570112   +453     
  Branches    22372    22372            
========================================
+ Hits       499769   500201   +432     
- Misses      69491    69512    +21     
  Partials      399      399            

@mifu67 mifu67 requested a review from a team as a code owner April 7, 2025 16:09
Comment on lines 129 to 131
return Response(
{"detail": "Cannot serialize details for a placeholder organization member"},
status=400,
Copy link
Member

Choose a reason for hiding this comment

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

should this respond 404? it's like the org member doesn't exist right?

Copy link
Member

Choose a reason for hiding this comment

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

similarly we can prevent editing by returning 404 on the org member details endpoint?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I missed the PUT, thanks for catching

@@ -123,6 +125,9 @@ def get(

Response will be a pending invite if it has been approved by organization owners or managers but is waiting to be accepted by the invitee.
"""
invite = OrganizationMemberInvite.objects.filter(organization_member_id=member.id).first()
Copy link
Member

Choose a reason for hiding this comment

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

can we move this check to _get_member? then you don't have to repeat it for GET, PUT, DELETE. didn't notice the extra function above

@mifu67 mifu67 merged commit 444d009 into master Apr 7, 2025
49 checks passed
@mifu67 mifu67 deleted the mifu67/member-merge/organization-member-updates branch April 7, 2025 18:37
andrewshie-sentry pushed a commit that referenced this pull request Apr 8, 2025
…rganization member invite changes (#88867)

- Prevent saving an existing OrganizationMember object if it's
associated with an OrganizationMemberInvite object
- Prevent serializing OrganizationMember objects that are associated
with OrganizationMemberInvite objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Backend Automatically applied to PRs that change backend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants