diff --git a/django/db/models/functions/base.py b/django/db/models/functions/base.py index bb4354ac87..5bcbbb8f06 100644 --- a/django/db/models/functions/base.py +++ b/django/db/models/functions/base.py @@ -222,11 +222,8 @@ class Substr(Func): if not hasattr(pos, 'resolve_expression'): if pos < 1: raise ValueError("'pos' must be greater than 0") - pos = Value(pos) expressions = [expression, pos] if length is not None: - if not hasattr(length, 'resolve_expression'): - length = Value(length) expressions.append(length) super().__init__(*expressions, **extra)