1
0
mirror of https://github.com/django/django.git synced 2025-11-07 07:15:35 +00:00

Fixed #28985 -- Removed unneeded None checks before hasattr().

This commit is contained in:
Дилян Палаузов
2018-01-03 11:34:10 -05:00
committed by Tim Graham
parent b3cd9fb18b
commit d79cf1e9e2
8 changed files with 14 additions and 17 deletions

View File

@@ -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
)