Skip to content

_TaggableManager mutating methods (add/set/remove/clear) are missing alters_data = True #953

Description

@joewesch

Django flags data-mutating model and manager methods with alters_data = True so the template engine refuses to invoke them during rendering. Django's own related managers set this flag on their mutating methods.

_TaggableManager does not set alters_data on any of its mutating methods. As a result, a template variable resolution that lands on one of these methods will silently execute the write instead of being skipped, which is exactly the footgun alters_data exists to prevent, and it's inconsistent with how every other Django manager behaves.

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