From 8125375715e7a339504980271e3c982315b3f1c2 Mon Sep 17 00:00:00 2001 From: Bryan Date: Tue, 25 Feb 2014 20:57:20 -0500 Subject: [PATCH] conditionally check honeypot errors, closes #346 --- karmaworld/apps/courses/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/karmaworld/apps/courses/views.py b/karmaworld/apps/courses/views.py index 332bd7c..acf38ed 100644 --- a/karmaworld/apps/courses/views.py +++ b/karmaworld/apps/courses/views.py @@ -69,7 +69,8 @@ class CourseListView(ListView, ModelFormMixin, ProcessFormView): # hard code errors for the dynamically named honeypot field. # This bit will not be necessary when the form is dynamically # generated by Django rather than hard coded in the template. - kwargs['honeypot_errors'] = [x for x in form.errors['honeypot']] + kwargs['honeypot_errors'] = [x for x in form.errors['honeypot']] if + 'honeypot' in form.errors else [] return self.render_to_response(self.get_context_data(**kwargs)) -- 2.25.1