From 47c48e9c662c4b8d7b2e140a5b2dd005c6a68af8 Mon Sep 17 00:00:00 2001 From: ichuang Date: Sun, 12 Aug 2012 19:07:31 -0400 Subject: [PATCH] fix student.views.create_account to handle errors from _do_create_account --- common/djangoapps/student/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index c88aeaf337..7924f5b6ce 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -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,