Opened 4 years ago

Closed 4 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


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.

Change History (2)

comment:1 follow-up: Changed 4 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 4 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).

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