fix student.views.create_account to handle errors from _do_create_account

This commit is contained in:
ichuang
2012-08-12 19:07:31 -04:00
parent f072979a6c
commit 47c48e9c66

View File

@@ -403,7 +403,10 @@ def create_account(request, post_override=None):
return HttpResponse(json.dumps(js))
# Ok, looks like everything is legit. Create the account.
(user, profile, registration) = _do_create_account(post_vars)
ret = _do_create_account(post_vars)
if isinstance(ret,HttpResponse): # if there was an error then return that
return ret
(user, profile, registration) = ret
d = {'name': post_vars['name'],
'key': registration.activation_key,