Skip to content

Disabled TagField messes data up #943

Description

@alice-telescoop

If the tags are set to for instance "tag1", "tag2" and a form TagField is set as disabled, the data that is sent to clean does not go through the widget's format_value method so it is '[<Tag: "tag1">, <Tag: "tag2">]' which is then parsed and saves the wrong data.

A quick fix I did in my project is to add

if self.disabled:
    return value

at the beginning of the clean form field method. In my project I inherited the widget to do that. In the module it may be better to fix the issue upstream, but here is the bug

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