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 Initial Version

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

ticket-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 (0)

Note: See TracTickets for help on using tickets.
Back to Top