diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index bdd23617ac..4ecae5f02d 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -1232,7 +1232,6 @@ class OrderBy(BaseExpression): 'ordering': 'DESC' if self.descending else 'ASC', **extra_context, } - template = template or self.template params *= template.count('%(expression)s') return (template % placeholders).rstrip(), params