diff options
author | Nishanth Amuluru | 2011-11-10 22:10:26 +0530 |
---|---|---|
committer | Nishanth Amuluru | 2011-11-10 22:10:26 +0530 |
commit | f569c1f1cea65f744f42941b5d7e75b49350d442 (patch) | |
tree | 23b1cb67582a49d93523aaa7ad3a1bbf81dacb02 /exam | |
parent | 5b2d3d506e277d57bae9a8b90dd348225347d486 (diff) | |
download | online_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')
-rw-r--r-- | exam/forms.py | 2 | ||||
-rw-r--r-- | exam/views.py | 10 |
2 files changed, 5 insertions, 7 deletions
diff --git a/exam/forms.py b/exam/forms.py index 7ee4b0e..38466e8 100644 --- a/exam/forms.py +++ b/exam/forms.py @@ -62,7 +62,7 @@ class UserRegisterForm(forms.Form): new_profile.roll_number = self.cleaned_data["roll_number"] new_profile.save() - return new_user + return u_name, pwd class UserLoginForm(forms.Form): username = forms.CharField(max_length = 30) 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}, |