From: dwickwire Date: Wed, 18 Jan 2012 21:18:02 +0000 (-0600) Subject: Fixing validation always being thrown on first visit. X-Git-Tag: 22.4~59 X-Git-Url: https://git.mdrn.pl/django-cas-provider.git/commitdiff_plain/7000b91d56bf8528a8a613f7b07f4307d89dffe7?hp=4a51c1aaa9c3eeac5368ff4e06870a94f18123aa Fixing validation always being thrown on first visit. -- still need to hide errors for hidden fields --- diff --git a/cas_provider/views.py b/cas_provider/views.py index ba7b0a2..5d9ea38 100644 --- a/cas_provider/views.py +++ b/cas_provider/views.py @@ -73,11 +73,13 @@ def login(request, template_name='cas/login.html', success_redirect='/account/', errors.append('This account is disabled.') else: errors.append('Incorrect username and/or password.') - else: if merge: form = MergeLoginForm(request.GET, request=request) else: form = LoginForm(request.GET, request=request) + else: + form = LoginForm(service) + return render_to_response(template_name, {'form': form, 'errors': errors}, context_instance=RequestContext(request)) def socialauth_login(request, template_name='cas/login.html', success_redirect='/account/'):