﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26027	Django model __init__ silently accepts parameters that are also a non-settable property	Klaas van Schelven	nobody	"When passing a keyword argument to a Django model instantiation, when the keyword argument also happens to be a non-settable property, this keyword argument is silently swallowed and nothing happens.

This may hide hard-to-track errors. It's also inconsistent (arguments which are not non-settable properties give an error like "".... is an invalid keyword argument for this function"")

This seems to have been introduced in ancient history: https://github.com/django/django/commit/1fc3b3229a9b137f05a0a49bdc726f8c91317174

However, looking at the tests that were introduced as a part of that particular commit I don't actually see a reason why the try/except block would be necessary in the first place (the included tests actually refer the opposite scenario, the one were a setter _is_ available). In fact, looking at the original test, this particular bug could simply be revealed by putting something like 

{{{
a = Person(full_name = 'Paul McCartney')
}}}

In an assertRaises.
 
(As of the status quo, this silently does nothing with the value ""Paul McCartney"")

I would have loved to do the work-proper to reveal the bug with tests; but I don't have the time for that now - sorry about that."	Uncategorized	closed	Uncategorized	1.8	Normal	duplicate			Unreviewed	0	0	0	0	0	0
