summaryrefslogtreecommitdiff
path: root/exam/views.py
diff options
context:
space:
mode:
authorNishanth Amuluru2011-11-10 22:10:26 +0530
committerNishanth Amuluru2011-11-10 22:10:26 +0530
commitf569c1f1cea65f744f42941b5d7e75b49350d442 (patch)
tree23b1cb67582a49d93523aaa7ad3a1bbf81dacb02 /exam/views.py
parent5b2d3d506e277d57bae9a8b90dd348225347d486 (diff)
downloadonline_test-f569c1f1cea65f744f42941b5d7e75b49350d442.tar.gz
online_test-f569c1f1cea65f744f42941b5d7e75b49350d442.tar.bz2
online_test-f569c1f1cea65f744f42941b5d7e75b49350d442.zip
Users will be directed to the exam automatically after they register
Diffstat (limited to 'exam/views.py')
-rw-r--r--exam/views.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/exam/views.py b/exam/views.py
index 43ac388..7ee3c53 100644
--- a/exam/views.py
+++ b/exam/views.py
@@ -38,13 +38,11 @@ def user_register(request):
form = UserRegisterForm(request.POST)
if form.is_valid():
data = form.cleaned_data
- new_user = form.save()
+ u_name, pwd = form.save()
- context = {}
- context['full_name'] = new_user.first_name.title() + " " + \
- new_user.last_name.title()
- return render_to_response('exam/register.html', context,
- context_instance=RequestContext(request))
+ new_user = authenticate(username = u_name, password = pwd)
+ login(request, new_user)
+ return redirect("/exam/start/")
else:
return render_to_response('exam/register.html',{'form':form},