Code

Opened 2 years ago

Closed 2 years ago

#18486 closed Bug (duplicate)

<model>.objects.none().update(**kwargs) updates everything!

Reported by: joseph.daywalt@… Owned by: nobody
Component: Database layer (models, ORM) Version: 1.1
Severity: Normal Keywords: update none emptyqueryset
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I know this is an old version, but I haven't seen any tickets relating to it for any version period. I'll look into some of the newer versions after I clean up the mess this made in production.

For a hypothetical model Cheese with more than 0 rows in the table, run Cheese.objects.none().update(kwargs) and it updates the whole table. It should short-circuit and return 0.

Attachments (0)

Change History (2)

comment:1 follow-up: Changed 2 years ago by anonymous

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I suspect this is #12142 though don't have time to verify at the moment.

comment:2 in reply to: ↑ 1 Changed 2 years ago by claudep

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

Replying to anonymous:

I suspect this is #12142 though don't have time to verify at the moment.

Yes, it is. Apparently, it has been fixed in the latest 1.1 release (1.1.4).

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.