Opened 9 years ago

Closed 9 years ago

#26620 closed Bug (fixed)

refresh_from_db() shouldn't ignore unknown keyword arguments

Reported by: Marti Raudsepp Owned by: Marti Raudsepp
Component: Database layer (models, ORM) Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

This code should raise a TypeError, but for some reason unknown keyword arguments are ignored:

a.refresh_from_db(unknown_kwarg=10)

Dunno if this is considered a bug or cleanup, but it can hide real mistakes in code.

Change History (4)

comment:1 by Tim Graham, 9 years ago

Cc: Anssi Kääriäinen added

Anssi, did you have a reason for the original design?

comment:2 by Anssi Kääriäinen, 9 years ago

I don't recall doing this intentionally. So, +1 to fixing it.

comment:3 by Tim Graham, 9 years ago

Cc: Anssi Kääriäinen removed
Summary: refresh_from_db() shouldn't ignore unknown keyword argumengsrefresh_from_db() shouldn't ignore unknown keyword arguments
Triage Stage: UnreviewedAccepted

comment:4 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In b9ae662:

Fixed #26620 -- Made Model.refresh_from_db() fail when passed unknown kwargs.

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