summaryrefslogtreecommitdiff
path: root/testapp/exam/forms.py
diff options
context:
space:
mode:
authorjayparikh1112012-02-01 10:33:57 +0530
committerjayparikh1112012-02-01 10:33:57 +0530
commit8f829495ea4a74e3e777cd1f4214781b9c63776b (patch)
tree4f0ad4693ea8c8d655f8bcda044781535e43334b /testapp/exam/forms.py
parent20346cca57a525c155fdd7f18253689c68645efd (diff)
parent5aa7fb163af95c27bb3aea4a1dee75ef406e0582 (diff)
downloadonline_test-8f829495ea4a74e3e777cd1f4214781b9c63776b.tar.gz
online_test-8f829495ea4a74e3e777cd1f4214781b9c63776b.tar.bz2
online_test-8f829495ea4a74e3e777cd1f4214781b9c63776b.zip
Merge branch 'visual_changes' of github.com:hardythe1/online_test into visual_changes
Diffstat (limited to 'testapp/exam/forms.py')
-rw-r--r--testapp/exam/forms.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/testapp/exam/forms.py b/testapp/exam/forms.py
index a5ca26f..d99a04d 100644
--- a/testapp/exam/forms.py
+++ b/testapp/exam/forms.py
@@ -85,8 +85,11 @@ class UserLoginForm(forms.Form):
def clean(self):
super(UserLoginForm, self).clean()
- u_name, pwd = self.cleaned_data["username"], self.cleaned_data["password"]
- user = authenticate(username = u_name, password = pwd)
+ try:
+ u_name, pwd = self.cleaned_data["username"], self.cleaned_data["password"]
+ user = authenticate(username = u_name, password = pwd)
+ except Exception:
+ raise forms.ValidationError("Username and/or Password is not entered")
if not user:
raise forms.ValidationError("Invalid username/password")