Skip to content

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

Description

@chosak

Any flag conditions of type "boolean" don't appear in the Wagtail flags UI, because of this use of conditions_without_bool. I gather this is to support the use of a boolean condition to toggle a flag on or off from the UI, but it can lead to some confusing behavior:

  • If you add a new boolean condition and save it, it doesn't show up on the flag's index page, but might impact how the enable/disable button works.
  • If you try to change an existing condition's type from something else to boolean, the form submission won't succeed, but no error message is shown.
  • It seems like if you try to add a boolean condition when one is already defined, the form submission won't succeed, but no error message is shown.

I encountered this problem because I wanted to manually disable a flag that already had an existing condition from Django settings, and thought that adding a boolean False flag would be a useful way to do that. But after trying to add that condition, it was unclear whether it had done anything or what the current logic was.

Two immediate ideas to address this: prevent use of boolean conditions in the UI, or migrate existing boolean conditions to some new "wagtail-flags-toggle" type which is deliberately distinct from booleans.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions