-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
chore(org member invite): changes to organization member to support organization member invite changes #88867
Conversation
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
Codecov ReportAll 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 |
return Response( | ||
{"detail": "Cannot serialize details for a placeholder organization member"}, | ||
status=400, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
…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