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

Improve organization creation #1262

Merged
merged 1 commit into from
Nov 28, 2017
Merged

Conversation

joshsmith
Copy link
Contributor

What's in this PR?

  • Removes fulfilled from invite
  • Replaces fulfilled with the organization id

Still needs tests.

|> OrganizationInvite.update_changeset(%{organization_id: organization_id})
|> Repo.update()
end
defp fulfill_associated_invite(%Organization{}, %{}), do: {:ok, nil}
Copy link
Contributor

Choose a reason for hiding this comment

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

I added this to support the old "creation by admin" behavior. I know it's not actually used anywhere, but i think the options then should be either remove it, or keep it working. Breaking it and leaving it in while broken adds confusion.

def get_organization_invite(%{"code" => code}),
do: OrganizationInvite |> Repo.get_by(code: code, fulfilled: false)
def get_organization_invite(%{}), do: nil

Copy link
Contributor

Choose a reason for hiding this comment

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

Moved it to Policy.Organization since it's the only place it's used in and we don't test ti directly.

- Add Organizations modules and fix changesets, add migration
- Changed fulfillment behavior to be code based
- Updated API docs
- Added explicit flagging as unapproved when creating organization
- Add test coverage for slug generation behavior
@joshsmith
Copy link
Contributor Author

I can't approve since it's my PR, but looks good. Merging when tests pass.

@joshsmith joshsmith merged commit 2f49598 into develop Nov 28, 2017
@joshsmith joshsmith deleted the improve-organization-creation branch November 28, 2017 18:07
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.

None yet

2 participants