Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/bitfield/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


def bitand(a, b):
return a.bitand(b)
return a & b
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Operators &/| on Django F expressions raise NotImplementedError

High Severity

The bitand and bitor functions are called with Django F() expressions as the first argument (e.g., bitor(F("flags"), ...)). In Django 5.2+, using & and | operators on F expressions raises NotImplementedError with the message "Use .bitand(), .bitor(), and .bitxor() for bitwise logical operations." The original .bitand() and .bitor() method calls were the correct Django API. This change breaks all bitwise flag update operations that use these helper functions.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit d9231bf. Configure here.



def bitor(a, b):
return a.bitor(b)
return a | b
Loading