From 4a51ba228b2c416a115aee3bc034683eb02482c3 Mon Sep 17 00:00:00 2001 From: Illia Volochii Date: Tue, 27 Dec 2016 16:42:17 +0200 Subject: Fixed #27642 -- Made forms.utils.flatatt() omit 'None' values from attrs. --- django/forms/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/forms') diff --git a/django/forms/utils.py b/django/forms/utils.py index dc4df86058..88086b2c64 100644 --- a/django/forms/utils.py +++ b/django/forms/utils.py @@ -40,7 +40,7 @@ def flatatt(attrs): if isinstance(value, bool): if value: boolean_attrs.append((attr,)) - else: + elif value is not None: key_value_attrs.append((attr, value)) return ( -- cgit v1.3