diff options
| author | Дилян Палаузов <Dilyan.Palauzov@db.com> | 2018-01-03 11:34:10 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-01-03 11:37:06 -0500 |
| commit | d79cf1e9e2887aa12567c8f27e384195253cb847 (patch) | |
| tree | cd272061983150b8d82907109ea208b950a065a4 /django/forms | |
| parent | b3cd9fb18ba127c067a4f3c79a32e51c8d8cc6ae (diff) | |
Fixed #28985 -- Removed unneeded None checks before hasattr().
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/models.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/django/forms/models.py b/django/forms/models.py index 84a07a275f..727cdb814a 100644 --- a/django/forms/models.py +++ b/django/forms/models.py @@ -1349,8 +1349,7 @@ class ModelMultipleChoiceField(ModelChoiceField): def modelform_defines_fields(form_class): - return (form_class is not None and ( - hasattr(form_class, '_meta') and - (form_class._meta.fields is not None or - form_class._meta.exclude is not None) - )) + return hasattr(form_class, '_meta') and ( + form_class._meta.fields is not None or + form_class._meta.exclude is not None + ) |
