From: Bryan Date: Wed, 26 Feb 2014 01:57:20 +0000 (-0500) Subject: conditionally check honeypot errors, closes #346 X-Git-Tag: release-20150131~163^2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=8125375715e7a339504980271e3c982315b3f1c2;p=oweals%2Fkarmaworld.git conditionally check honeypot errors, closes #346 --- 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))