From e16c48e001ccd06830bb0bfd1d20e22ec30fce59 Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Sun, 24 Mar 2013 13:47:01 +0100 Subject: Fixed #15124 -- Changed the default for BooleanField. Thanks to the many contributors who updated and improved the patch over the life of this ticket. --- django/contrib/flatpages/models.py | 6 ++++-- django/db/models/fields/__init__.py | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'django') diff --git a/django/contrib/flatpages/models.py b/django/contrib/flatpages/models.py index 896bfa3eac..42bb3adf23 100644 --- a/django/contrib/flatpages/models.py +++ b/django/contrib/flatpages/models.py @@ -11,10 +11,12 @@ class FlatPage(models.Model): url = models.CharField(_('URL'), max_length=100, db_index=True) title = models.CharField(_('title'), max_length=200) content = models.TextField(_('content'), blank=True) - enable_comments = models.BooleanField(_('enable comments')) + enable_comments = models.BooleanField(_('enable comments'), default=False) template_name = models.CharField(_('template name'), max_length=70, blank=True, help_text=_("Example: 'flatpages/contact_page.html'. If this isn't provided, the system will use 'flatpages/default.html'.")) - registration_required = models.BooleanField(_('registration required'), help_text=_("If this is checked, only logged-in users will be able to view the page.")) + registration_required = models.BooleanField(_('registration required'), + help_text=_("If this is checked, only logged-in users will be able to view the page."), + default=False) sites = models.ManyToManyField(Site) class Meta: diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 1f0ce5e4ed..142b33f6a7 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -620,8 +620,6 @@ class BooleanField(Field): def __init__(self, *args, **kwargs): kwargs['blank'] = True - if 'default' not in kwargs and not kwargs.get('null'): - kwargs['default'] = False Field.__init__(self, *args, **kwargs) def get_internal_type(self): -- cgit v1.3