Closed W1ldPo1nter closed 2 months ago
This looks like a manifest bug to me. 👍 Would you like to create a pull request to fix it, preferably with a small regression test?
I would like to, but I won't get around to it until the end of the month or beginning of August due to being on vacation. If the issue is still open at that point, I can prepare a PR.
The following issue occurs in the folder admin: if a directory listing is filtered via the search field (leading to the
q
query parameter being set) and then the "move" action (internal name:move_files_and_folders
) is used on at least one of the files, the following error is raised:This is an annotated field that is only added/used in a single place. I didn't check why this happens in depth, but have made the following observations:
UPDATE
query, and I don't know why Django tries to evaluate ordering on an update query at all.Lower
annotation then references an annotation that's no longer present.A simple fix that wouldn't require an in-depth investigation could be to not use
.annotate()
at all and pass the entire annotation to.order_by()
instead by changing this part:to:
That way, the ordering no longer relies on an annotation that is removed by Django. However, I don't know if that would work in all supported Django versions (I just quickly tested it with Django 4.2).