diff --git a/model_utils/fields.py b/model_utils/fields.py index 35f0cc80..75dc0b03 100644 --- a/model_utils/fields.py +++ b/model_utils/fields.py @@ -2,7 +2,6 @@ import secrets import uuid -from collections.abc import Callable from django.conf import settings from django.core.exceptions import ValidationError @@ -329,7 +328,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