Added grade URL so admin can access information about schedule
[cascardo/eventmanager.git] / decorators.py
index 079a484..6918158 100644 (file)
@@ -17,7 +17,10 @@ License along with this program; if not, write to the
 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.
 
+    Changes:
+
     * Lincoln de Sousa (22 Jul 2007) adding is_login_form here.
+
 """
 from django.contrib.auth.forms import AuthenticationForm
 from django.contrib.auth import login
@@ -40,10 +43,9 @@ def enable_login_form(func):
                     request.session.delete_test_cookie()
                 except KeyError:
                     pass
+                return HttpResponseRedirect('/')
             else:
-                # TODO: Notify the user that data sent is wrong.
-                msg = _('User name and Password doesn\'t match')
-                request.error_message = msg
+                return HttpResponseRedirect('/?login_failed')
 
         request.session.set_test_cookie()
         return func(request, *args, **kwargs)