diff options
author | Primal Pappachan | 2012-04-12 12:24:16 +0530 |
---|---|---|
committer | Primal Pappachan | 2012-04-12 12:24:16 +0530 |
commit | 2baceda13bea9c8e8f6360a1c46ab220ea60c14f (patch) | |
tree | f4923245db6192c2aef5f089e24f0e9971f5661f | |
parent | 983103c96ffac65f1ad22386f48407fe832f972e (diff) | |
download | aloha-2baceda13bea9c8e8f6360a1c46ab220ea60c14f.tar.gz aloha-2baceda13bea9c8e8f6360a1c46ab220ea60c14f.tar.bz2 aloha-2baceda13bea9c8e8f6360a1c46ab220ea60c14f.zip |
getting profile only if user exists
-rw-r--r-- | aloha/allotter/forms.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/aloha/allotter/forms.py b/aloha/allotter/forms.py index 3547f88..5112884 100644 --- a/aloha/allotter/forms.py +++ b/aloha/allotter/forms.py @@ -106,11 +106,11 @@ class UserLoginForm(forms.Form): ##Authentication part user = authenticate(username = u_name, password = pwd) + if not user: + raise forms.ValidationError("Registration Number doesn't match.") user_profile = user.get_profile() user_profile.dd_no = dd_no user_profile.save() - if not user: - raise forms.ValidationError("Application Number or Registration Number doesn't match.") return user def __init__(self, *args, **kwargs): |