diff options
| author | Vytis Banaitis <vytis.banaitis@gmail.com> | 2017-02-12 16:43:04 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-02-16 12:35:40 -0500 |
| commit | eedf276ed1b247c87d3852db4241da1aa9779589 (patch) | |
| tree | 7df519aa311499034a9f4c61d464333a9ed6f11f /django | |
| parent | 4f0185aac39fff4a5f1a3a3f103e6e920eb60703 (diff) | |
[1.11.x] Fixed #27828 -- Fixed a crash when subtracting Integer/DurationField from DateField on Oracle/PostgreSQL.
Backport of d5088f838d837fc9e3109c828f18511055f20bea from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/expressions.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/expressions.py b/django/db/models/expressions.py index 36c2b969db..01f1333651 100644 --- a/django/db/models/expressions.py +++ b/django/db/models/expressions.py @@ -390,7 +390,7 @@ class CombinedExpression(Expression): return DurationExpression(self.lhs, self.connector, self.rhs).as_sql(compiler, connection) if (lhs_output and rhs_output and self.connector == self.SUB and lhs_output.get_internal_type() in {'DateField', 'DateTimeField', 'TimeField'} and - lhs_output.get_internal_type() == lhs_output.get_internal_type()): + lhs_output.get_internal_type() == rhs_output.get_internal_type()): return TemporalSubtraction(self.lhs, self.rhs).as_sql(compiler, connection) expressions = [] expression_params = [] |
