Fix inverted logic

This commit is contained in:
Jeremy Stretch 2025-08-11 13:49:42 -04:00
parent 8ff2bc5dff
commit 78b55b8515

View File

@ -37,7 +37,7 @@ class JSONEmpty(Lookup):
if value not in (True, False): if value not in (True, False):
raise ValueError("The 'empty' lookup only accepts True or False.") raise ValueError("The 'empty' lookup only accepts True or False.")
condition = 'NOT ' if value else '' condition = '' if value else 'NOT '
sql = f"(NULLIF({lhs_sql}, '') IS {condition}NULL)" sql = f"(NULLIF({lhs_sql}, '') IS {condition}NULL)"
return sql, lhs_params return sql, lhs_params