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:05:21 +0200 |
| commit | 272eccf7ff0ced609e5a5e3bb6b4a40e773e0e66 (patch) | |
| tree | 59689e5a6fd7e68401097ecbfb3f214f7c2ad315 /django | |
| parent | 7bc5274f6faf9e5296688d4708de0272a758e3f0 (diff) | |
Fixed #26983 -- Fixed isnull filtering on ForeignKey with to_field
Thanks weidwonder for the report.
Diffstat (limited to 'django')
| -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] |
