Skip to content

QuerySet.delete() on any soft-deleted model raises RecursionError #4292

Description

@ch0rizo

PersistentModelQuerySet.delete() at lego/utils/managers.py:24 does instances.delete() on a queryset of its own class, calling itself forever.

Confirmed: Event.objects.filter(...).delete() -> RecursionError.

Dormant in production - app code consistently iterates and calls instance .delete() instead, which suggests people have hit this and worked around it without fixing it. But it's a landmine on every persistent model in LEGO. And note the second half: the method's docstring says it sets deleted=True, but nothing in it does.

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

    backendbugchorePull requests that does something "boring", yet important, e.g. cleaning up code

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions