diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-03-24 13:47:01 +0100 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2013-03-24 13:47:01 +0100 |
| commit | e16c48e001ccd06830bb0bfd1d20e22ec30fce59 (patch) | |
| tree | 3281a2007b0df0ad3653117dbd23a81acda5dea2 /django | |
| parent | ae417dd4d569669e8e1d8f15e643c6ba0820aafe (diff) | |
Fixed #15124 -- Changed the default for BooleanField.
Thanks to the many contributors who updated and improved the patch over
the life of this ticket.
Diffstat (limited to 'django')
| -rw-r--r-- | django/contrib/flatpages/models.py | 6 | ||||
| -rw-r--r-- | django/db/models/fields/__init__.py | 2 |
2 files changed, 4 insertions, 4 deletions
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): |
