edx/edx-platform — pull request #2957 by jimabramson (2014-03-17 15:50:54+00:00)
Title: Ensure account creation succeeds before creating comments service user

Intent of this change:

* prevent the creation of invalid/orphaned comments service users, which lead to user-facing 500's and inability to access forums. Part of this change involves adding an explicit db transaction around the call to ```student.views._do_create_account```.
* recover more gracefully from cases where comments service user creation failed in the past (no longer necessary to log out / in again).
** This behavior depends on https://github.com/edx/cs_comments_service/pull/91

Prior behavior is to perform a PUT to the comments service every time ```save()``` is called on an auth_user (via post_save signal). This can happen even if the user account hasn't been committed to the db yet.

New behavior is to only perform the PUT after the user account has been committed. If for some reason the PUT fails, it will be retried the next time we try to find their comments service user. (If the retry fails, the user will see an error and the exception will be logged.)

The removal of many unnecessary PUT calls to the comments service is a side benefit.

JIRA: FOR-522

@gwprice @e0d @ormsbee