--- a/pytask/taskapp/views/user.py Fri Jan 29 23:34:19 2010 +0530
+++ b/pytask/taskapp/views/user.py Sat Jan 30 13:03:09 2010 +0530
@@ -6,10 +6,10 @@
from django.contrib.auth import login, logout, authenticate
from django.contrib.auth.models import User
-def redirect_to_homepage(request):
+def show_msg(error_msg):
""" simply redirect to homepage """
- return redirect('/')
+ return render_to_response('error.html',{'error_msg':error_msg})
def homepage(request):
""" check for authentication and display accordingly. """
@@ -81,7 +81,7 @@
login(request, user)
return redirect('/')# Redirect to a success page.
else:
- return HttpResponse('username is not active, please contact the administrator')# Return a 'disabled account' error message
+ return show_msg('username is not active, please contact the administrator')# Return a 'disabled account' error message
else:
errors = ['Please check your username and password']
form = LoginForm()
@@ -93,4 +93,4 @@
def user_logout(request):
logout(request)
- return HttpResponse('You have logged off successfully!!!')
+ return show_msg('You have logged off successfully!!!')