From 40ffabe8dc81244ab8ee53e1318517b37cb71284 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Thu, 23 Mar 2017 19:50:56 +0500 Subject: [PATCH] Removed unneeded Value wraps in Substr. Unneeded since e2d6e14662d780383e18066a3182155fb5b7747b. --- django/db/models/functions/base.py | 3 --- 1 file changed, 3 deletions(-) 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)