Leaklens

django__django-11163

model_to_dict() should return an empty dict for an empty list of fields.

Verdict: the fix is stated in the issue (Tier A).

The problem point is if fields and f.name not in fields: which should be if fields is not None and f.name not in fields:

The text states the fix: “The problem point is if fields and f.name not in fields: which should be if fields is not None and f.name not in fields:”

All SWE-bench Verified tasks · more django/django tasks · How the check works