Opened 96 minutes ago

Last modified 89 minutes ago

#37047 new Bug

Crash in Query.orderby_issubset_groupby for descending and random order_by strings

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, 89 minutes ago

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