From 0a58d227716e14c047ee428feeb0ce53bca44c89 Mon Sep 17 00:00:00 2001
From: Lagovas <lagovas.lagovas@gmail.com>
Date: Wed, 24 Sep 2014 10:46:37 +0300
Subject: [PATCH] fix BooleanField in case when field is required and has value
False (always raised ValidationError)
---
django/forms/fields.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/django/forms/fields.py b/django/forms/fields.py
index 966b303..314ed2e 100644
a
|
b
|
class BooleanField(Field):
|
703 | 703 | return super(BooleanField, self).to_python(value) |
704 | 704 | |
705 | 705 | def validate(self, value): |
706 | | if not value and self.required: |
707 | | raise ValidationError(self.error_messages['required'], code='required') |
| 706 | pass |
708 | 707 | |
709 | 708 | def _has_changed(self, initial, data): |
710 | 709 | # Sometimes data or initial could be None or '' which should be the |