diff -r 4c1d3fe9fef1 -r fd37bbece439 reg/views.py --- a/reg/views.py Thu Apr 15 16:40:30 2010 +0530 +++ b/reg/views.py Thu Apr 15 17:03:16 2010 +0530 @@ -44,12 +44,9 @@ password = form.cleaned_data['password'] username = User.objects.get(email__iexact=email).username - user = authenticate(username=username, password=password) - if user.is_active: - login(request, user) - return redirect('/reg') - else: - return render_to_response('account_inactive.html', {'email':email}) + new_user = authenticate(username=username, password=password) + login(request, new_user) + return redirect('/reg') else: return render_to_response('login.html', {'user':user, 'form':form}) else: @@ -134,6 +131,9 @@ """ user = request.user + if not user.is_authenticated(): + raise Http404 + try: email = request.GET['email'] except MultiValueDictKeyError: @@ -361,7 +361,7 @@ """ user = request.user - if not user.is_authenticated(): + if not ( user.is_authenticated() and user.is_active ): return redirect('/reg') user_profile = user.get_profile()