diff --git a/model_utils/fields.py b/model_utils/fields.py index 139a3dad..fb99991d 100644 --- a/model_utils/fields.py +++ b/model_utils/fields.py @@ -3,7 +3,6 @@ import secrets import uuid import warnings -from collections.abc import Callable from django.conf import settings from django.core.exceptions import ValidationError @@ -340,7 +339,7 @@ def __init__(self, editable=False, max_length=128, factory=None, **kwargs): non-callable value for factory is not supported. """ - if factory is not None and not isinstance(factory, Callable): + if factory is not None and not callable(factory): raise TypeError("'factory' should either be a callable or 'None'") self._factory = factory