From d79cf1e9e2887aa12567c8f27e384195253cb847 Mon Sep 17 00:00:00 2001 From: Дилян Палаузов Date: Wed, 3 Jan 2018 11:34:10 -0500 Subject: Fixed #28985 -- Removed unneeded None checks before hasattr(). --- django/forms/models.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'django/forms') 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 + ) -- cgit v1.3