Opened 4 hours ago

Last modified 4 hours ago

#37047 new Bug

Crash in Query.orderby_issubset_groupby for descending and random order_by strings — at Version 1

Reported by: Anže Pečar Owned by:
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Anže Pečar)

#26434 caused a crash. It can be reproduced with:

User.objects.values("is_staff").annotate(latest=Max("date_joined")).order_by("-latest").count()

You should see the following exception:

django.core.exceptions.FieldError: Cannot resolve keyword '-latest' into field. Choices are: activity_logs, date_joined, email, first_name, groups, id, is_active, is_administrator, is_staff, is_superuser, last_login, last_name, latest, logentry, module_access, password, user_permissions, username

Change History (1)

comment:1 by Anže Pečar, 4 hours ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top