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

[MNOE-819] Update error handling when inviting user to organization #595

Open
wants to merge 2 commits into
base: 3.3
Choose a base branch
from

Conversation

adamaziz15
Copy link
Contributor

@ouranos Ready for review. Leaving comments in JIRA.

@ouranos
Copy link
Contributor

ouranos commented Dec 5, 2017

Can you rebase and open the PR against 3.3? Thanks

@ouranos ouranos requested review from x4d3 and ouranos December 5, 2017 03:04
@adamaziz15 adamaziz15 force-pushed the bug/819-duplicate-invites branch from 67f0cf2 to 68b9bfc Compare December 5, 2017 16:40
@adamaziz15 adamaziz15 changed the base branch from feature/tasks to 3.3 December 5, 2017 16:41
@adamaziz15 adamaziz15 force-pushed the bug/819-duplicate-invites branch from 68b9bfc to 1dc62fe Compare December 5, 2017 16:51
@adamaziz15
Copy link
Contributor Author

@ouranos Updated to branch 3.3

@ouranos ouranos added this to the v3.3 milestone Jan 16, 2018
Copy link
Contributor

@ouranos ouranos left a comment

Choose a reason for hiding this comment

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

See comments, needs another rebase as well ;)

@@ -73,14 +73,19 @@ def invite_member
user = MnoEnterprise::User.find_by(email: user_params[:email]) || create_unconfirmed_user(user_params)

# Create the invitation
invite = @organization.org_invites.create(
invite = MnoEnterprise::OrgInvite.create(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

@@ -157,7 +157,7 @@ def partial_hash_for_arrears(arrear)
# Track the api call
@api_call = false
stub = -> { @api_call = true; from_api(org_invite) }
api_stub_for(post: "/organizations/#{organization.id}/org_invites", response: stub)
api_stub_for(post: "/org_invites", response: stub)
Copy link
Contributor

Choose a reason for hiding this comment

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

We need a spec for when the invitation is not saved.
I think persisted? is just checking the id so you can have a stub without id for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants