Check-in rules: Add now_isoweekday and minutes_since_last_entry (#2577)

This commit is contained in:
Raphael Michel
2022-04-21 17:17:59 +02:00
committed by GitHub
parent 0aff74afc6
commit 316081658a
5 changed files with 222 additions and 7 deletions

View File

@@ -188,6 +188,7 @@ class CheckinList(LoggedModel):
# * in pretix.helpers.jsonlogic_boolalg
# * in checkinrules.js
# * in libpretixsync
# * in pretixscan-ios (in the future)
top_level_operators = {
'<', '<=', '>', '>=', '==', '!=', 'inList', 'isBefore', 'isAfter', 'or', 'and'
}
@@ -195,7 +196,8 @@ class CheckinList(LoggedModel):
'buildTime', 'objectList', 'lookup', 'var',
}
allowed_vars = {
'product', 'variation', 'now', 'entries_number', 'entries_today', 'entries_days'
'product', 'variation', 'now', 'now_isoweekday', 'entries_number', 'entries_today', 'entries_days',
'minutes_since_last_entry', 'minutes_since_first_entry',
}
if not rules or not isinstance(rules, dict):
return rules