Skip to content

Disallow manual boolean conditions in admin form - #83

Open
arpitjain099 wants to merge 1 commit into
cfpb:mainfrom
arpitjain099:chore/fix-boolean-condition-ui
Open

arpitjain099 wants to merge 1 commit into
cfpb:mainfrom
arpitjain099:chore/fix-boolean-condition-ui

Conversation

@arpitjain099

Copy link
Copy Markdown

Fixes #65.

Boolean conditions are used as the internal on/off toggle, but the condition editor still accepted them. That makes the UI confusing because those entries are hidden from the flag detail table.

This change hides boolean from the condition dropdown for normal create/edit flows, and it returns a clear validation error if someone submits condition=boolean directly. Existing boolean records can still be edited through their direct URL for backward compatibility.

I also added test coverage for both form behaviors.

I ran DJANGO_SETTINGS_MODULE=wagtailflags.tests.settings .venv/bin/django-admin test.

Signed-off-by: Arpit Jain <arpitjain099@gmail.com>

This branch has not been deployed

No deployments
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.

Boolean flag conditions don't work as expected in the UI

1 participant