fle-internal/ka-lite-central — pull request #183 by dylanjbarth (2014-07-03 21:22:16+00:00)
Title: Fix 2210: we now only create orgs and users together, so weird things do...

Fixes https://github.com/learningequality/ka-lite/issues/2210

Previous behavior: create the admin user even if org form isn't valid, which created a weird circumstance where the user signing up would register their email but the form wouldn't completely submit, and then they would get a second error saying that their email was already in use.

New behavior:

1. If the user has been invited, don't show an org form and do not create an org for them
2. If they haven't, and they fill out the form but omit the organization name, create an organization with their first and last name. E.g. Dylan Barth's Organization
3. If they haven't, and they fill out the form correctly, do everything normally.