parent
7b6524e0ff
commit
40ffabe8dc
|
@ -222,11 +222,8 @@ class Substr(Func):
|
||||||
if not hasattr(pos, 'resolve_expression'):
|
if not hasattr(pos, 'resolve_expression'):
|
||||||
if pos < 1:
|
if pos < 1:
|
||||||
raise ValueError("'pos' must be greater than 0")
|
raise ValueError("'pos' must be greater than 0")
|
||||||
pos = Value(pos)
|
|
||||||
expressions = [expression, pos]
|
expressions = [expression, pos]
|
||||||
if length is not None:
|
if length is not None:
|
||||||
if not hasattr(length, 'resolve_expression'):
|
|
||||||
length = Value(length)
|
|
||||||
expressions.append(length)
|
expressions.append(length)
|
||||||
super().__init__(*expressions, **extra)
|
super().__init__(*expressions, **extra)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue