diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-08-02 17:27:45 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2016-08-04 16:07:11 +0200 |
| commit | 6757c94662ef07e35eafcf3ac8bdae07a3d9326a (patch) | |
| tree | 7c4cea5baade03bf45e3aa17aab0ad8aa6dc6e63 /django/db/models/fields | |
| parent | dcebeea2703322bc53c511bf3cff9e3c2e04d802 (diff) | |
[1.10.x] Fixed #26983 -- Fixed isnull filtering on ForeignKey with to_field
Thanks weidwonder for the report.
Backport of 272eccf7ff0ced609e5a5e3bb6b4a40e773e0e66 from master.
Diffstat (limited to 'django/db/models/fields')
| -rw-r--r-- | django/db/models/fields/related_lookups.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/fields/related_lookups.py b/django/db/models/fields/related_lookups.py index 5454031c2a..de2564fb0d 100644 --- a/django/db/models/fields/related_lookups.py +++ b/django/db/models/fields/related_lookups.py @@ -93,7 +93,7 @@ class RelatedLookupMixin(object): # ForeignKey to IntegerField given value 'abc'. The ForeignKey itself # doesn't have validation for non-integers, so we must run validation # using the target field. - if hasattr(self.lhs.output_field, 'get_path_info'): + if self.prepare_rhs and hasattr(self.lhs.output_field, 'get_path_info'): # Get the target field. We can safely assume there is only one # as we don't get to the direct value branch otherwise. target_field = self.lhs.output_field.get_path_info()[-1].target_fields[-1] |
