mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #30302 -- Fixed forms.model_to_dict() result if empty list of fields is passed.
This commit is contained in:
committed by
Mariusz Felisiak
parent
714cf468e1
commit
1ffddfc233
@@ -83,7 +83,7 @@ def model_to_dict(instance, fields=None, exclude=None):
|
||||
for f in chain(opts.concrete_fields, opts.private_fields, opts.many_to_many):
|
||||
if not getattr(f, 'editable', False):
|
||||
continue
|
||||
if fields and f.name not in fields:
|
||||
if fields is not None and f.name not in fields:
|
||||
continue
|
||||
if exclude and f.name in exclude:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user