Skip to content

Remove the TaggableManager monkeypatch by fixing its stale registration #786

Open

Description

@bctiemann

Proposed Changes

Problem: The TaggableManager monkeypatch, its global lock and its ValueError swallow work around taggit resolving the stale registered class by name; a polymorphic through is re-registered with an unsuppressed warning.

Fix: Pop the old registration before type() so taggit fires on the new class; remove the patch, lock and re-registers.

Where (line numbers as of a61cd70; they will have drifted): models.py:1905–1961, 1645

Audit: finding E5, severity Medium, effort M, originally batch 5 (#737). Not re-checked after the review: first confirm it against current main (reproduce it, or point to the code) before fixing.

Note: Possibly related to #755 / #756 (stale models left registered in other workers); check whether that fix removes the stale registration this patch works around.

Justification

Medium severity; not a v1.0 blocker. Tracked in #759 under tier 3 (robustness and performance), re-sliced from the pre-1.0 code audit so each fix gets its own reviewable PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    app: custom objectscomplexity: mediumRequires a substantial but not unusual amount of effort to implementseverity: mediumResults in substantial degraded or broken functionality for specific workflowsstatus: backlogtype: housekeepingChanges to the application which do not directly impact the end user

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions