-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Epic 2 APIs #319
Epic 2 APIs #319
Conversation
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.
Great work! Needs a few changes though.
Added changes to admins not being able to demote other admins and moving code from invite_users to "add_members_to_partners". |
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.
Still a few changes needed on this one. Sorry I didn't catch the missing tests issue earlier.
request, | ||
"add_partner_member", | ||
|
||
@bp.route("/remove_member", methods=['DELETE']) |
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.
Just like the role change, we shouldn't let an admin forcibly remove another admin without notification.
@@ -221,18 +220,22 @@ def test_partner_pagination(client, example_partners, access_token): | |||
assert res.status_code == 404 | |||
|
|||
|
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.
We should add tests for the new API endpoints here. We're missing:
- /invite
- /join
- /leave
- /remove_member
- /withdraw_invitation
- /role_change
- /invitations
- /stagedinvitations
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've added tests for every endpoint except /invite. That one requires the mail server to be set up. Also, did not add tests for /invitations, and /staged_invitations as those are for the dev env, and I just wanted endpoints to view the current state of the db. We could remove them if you want.
# assert partner_member_obj.partner_id == created["partner_id"] | ||
# assert partner_member_obj.email == created["email"] | ||
# assert partner_member_obj.role == created["role"] | ||
""" |
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.
No need to worry about testing the mailing functionality here. We can handle that in a seperate test. For the purposes of these tests, just assume the mail feature is working.
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.
Looks good!
Looks like I have to re-request review for this after fixing some merge conflicts between main and invite_users. |
No problem! You're good to go. |
1)Inviting users to NPDC
Ticket:
https://www.notion.so/developforgood/b3a0d3450c3f4440bed354fcbbbbd455?v=99a42947c6f9479ca891d4f0ee3462e1&p=1dedd2178ba94239963285adddbc672b&pm=s
The configuration settings for the mail server needs to be changed in the dotenv depending on if we're using Amazon Simple Email Service or some other tool. I was using mailtrap.io for testing.
2)Users can join/leave organization
Ticket:
https://www.notion.so/developforgood/b3a0d3450c3f4440bed354fcbbbbd455?v=99a42947c6f9479ca891d4f0ee3462e1&p=9f0b34313c434b90b97c296d57cbe5b3&pm=s
3)Remove users from org/withdraw their invitation
Ticket:
https://www.notion.so/developforgood/b3a0d3450c3f4440bed354fcbbbbd455?v=99a42947c6f9479ca891d4f0ee3462e1&p=db318391f99849c488c38c0c6610ef2e&pm=s
4)Change roles of users in a partner org
Ticket:
https://www.notion.so/developforgood/b3a0d3450c3f4440bed354fcbbbbd455?v=99a42947c6f9479ca891d4f0ee3462e1&p=3cbd315ee9144897b36d476f7832dae8&pm=s