mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31664 -- Reallowed using non-expressions having filterable attribute as rhs in queryset filters.
Regression in 4edad1ddf6.
This commit is contained in:
committed by
Mariusz Felisiak
parent
78ad4b4b02
commit
b38d44229f
@@ -1124,7 +1124,10 @@ class Query(BaseExpression):
|
||||
|
||||
def check_filterable(self, expression):
|
||||
"""Raise an error if expression cannot be used in a WHERE clause."""
|
||||
if not getattr(expression, 'filterable', True):
|
||||
if (
|
||||
hasattr(expression, 'resolve_expression') and
|
||||
not getattr(expression, 'filterable', True)
|
||||
):
|
||||
raise NotSupportedError(
|
||||
expression.__class__.__name__ + ' is disallowed in the filter '
|
||||
'clause.'
|
||||
|
||||
Reference in New Issue
Block a user