mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Check-in rules SQL: Deal with empty boolean operations
This commit is contained in:
@@ -153,8 +153,8 @@ class SQLLogic:
|
|||||||
def __init__(self, list):
|
def __init__(self, list):
|
||||||
self.list = list
|
self.list = list
|
||||||
self.bool_ops = {
|
self.bool_ops = {
|
||||||
"and": lambda *args: reduce(lambda total, arg: total & arg, args),
|
"and": lambda *args: reduce(lambda total, arg: total & arg, args) if args else Q(),
|
||||||
"or": lambda *args: reduce(lambda total, arg: total | arg, args),
|
"or": lambda *args: reduce(lambda total, arg: total | arg, args) if args else Q(),
|
||||||
}
|
}
|
||||||
self.comparison_ops = {
|
self.comparison_ops = {
|
||||||
"==": partial(self.comparison_to_q, operator=Equal),
|
"==": partial(self.comparison_to_q, operator=Equal),
|
||||||
|
|||||||
Reference in New Issue
Block a user