Skip to content

Conversation

titusz
Copy link

@titusz titusz commented Sep 6, 2025

The issue occurs because Django Unfold's constance integration uses django.forms.BooleanField with the default
configuration, which has required=True by default. In Django's BooleanField:

  • required=True means the checkbox MUST be checked for the form to validate
  • required=False means the checkbox can be either checked (True) or unchecked (False/None)

When a user tries to uncheck a boolean setting in django-constance through Unfold's interface, the form validation
fails because the BooleanField expects the checkbox to be checked (since required=True).

The issue occurs because Django Unfold's constance integration uses django.forms.BooleanField with the default
  configuration, which has required=True by default. In Django's BooleanField:
  - required=True means the checkbox MUST be checked for the form to validate
  - required=False means the checkbox can be either checked (True) or unchecked (False/None)

  When a user tries to uncheck a boolean setting in django-constance through Unfold's interface, the form validation
   fails because the BooleanField expects the checkbox to be checked (since required=True).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant