Code

Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#14513 closed (fixed)

Ordering Check in django/core/management/validation.py

Reported by: vanschelven Owned by: nobody
Component: Database layer (models, ORM) Version: 1.2
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

django/core/management/validation.py, both in the current trunk and in 1.2.3
It says in the accompanying comment:

# Skip ordering in the format field1__field2 (FIXME: checking 
# this format would be nice, but it's a little fiddly). 

However, the actual check is for only one "_". Which leads fieldnames which contain underscores to not be checked for
ordering;

The patch would be something like this:

260c260 
<                 if '__' in field_name: 
--- 
>                 if '_' in field_name: 

I will go through some hoops to put up an actual patch here.

Attachments (1)

django-14513-e62b9ba4e02c.diff (2.0 KB) - added by vanschelven 4 years ago.
Patch

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by vanschelven

Patch

comment:1 Changed 4 years ago by vanschelven

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 4 years ago by lrekucki

  • Component changed from Uncategorized to Database layer (models, ORM)
  • Triage Stage changed from Unreviewed to Ready for checkin

Tested, looks simple, marking for checkin.

comment:3 Changed 3 years ago by Alex

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [14315].

comment:4 Changed 3 years ago by SmileyChris

(In [14317]) [1.2.X] Fixed #14513 -- check fields with underscores for validity when ordering. Bonus points to Klaas van Schelven.

Backport from trunk (r14315)

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.