Skip to content

ProjectItemPositionManager needs to be refactored to support WebhookAutomationRule #12796

@humitos

Description

@humitos

It fails because we are using polymorphic models here. It checks for the maximum priority on the actual model, but there is no objects there, so it starts from 0 again, but there is another model --using the same db table-- with priority=0 already, so it fails. We need to filter by all polymorphic models to fix this.

I didn't want to deal with that just now, so I skipped this positioning for now since we will create the objects manually from the Django shell for now.

The code is at https://github.com/readthedocs/readthedocs.org/blob/main/readthedocs/projects/ordering.py#L6

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