mirror of
https://github.com/pretix/pretix.git
synced 2026-08-25 13:12:00 +00:00
Allow RelativeDate in relation to a moment of order (#6160)
* initial implementation * factor out _resolve_base_date * add js to prevent illegal inputs * fix tests * Update src/pretix/base/reldate.py Co-authored-by: Raphael Michel <michel@pretix.eu> * Apply suggestions from code review Co-authored-by: Raphael Michel <mail@raphaelmichel.de> * move js includes of to fragment_js.html * add type annotations * moves logic from RelativeDateWrapper into RelativeDate and adds BaseChoice for configuring which models attributes support which relationship * fix tests * test upgrade behaviour * Apply suggestions from code review Co-authored-by: Raphael Michel <mail@raphaelmichel.de> * move reldate.js include in correct file * add OptionAttrsSelect to allow select options with their own attributes per value * add a little bit of information to the tests for future reference * rewrite reldate.js use data-attributes * general cleanup * add test for order.subevents cases * use correct choice format * remove order.subevent variants * various cleanup * Apply suggestions from code review Co-authored-by: Raphael Michel <mail@raphaelmichel.de> * remove empty docstrings * add depreciation warning * change event listener to pretix:bind-forms --------- Co-authored-by: Raphael Michel <michel@pretix.eu> Co-authored-by: Raphael Michel <mail@raphaelmichel.de>
This commit is contained in:
co-authored by
Raphael Michel
Raphael Michel
parent
f25c233e91
commit
7fe31634e6
@@ -481,7 +481,7 @@ class EventsTest(SoupTest):
|
||||
'payment_term_last_0': 'absolute',
|
||||
'payment_term_last_1': (self.event1.presale_end - datetime.timedelta(1)).strftime('%Y-%m-%d'),
|
||||
'payment_term_last_2': '0',
|
||||
'payment_term_last_3': 'date_from',
|
||||
'payment_term_last_3': 'event__date_from',
|
||||
'tax_rule_payment': 'default',
|
||||
})
|
||||
assert doc.select('.alert-danger')
|
||||
@@ -496,7 +496,7 @@ class EventsTest(SoupTest):
|
||||
'payment_term_last_0': 'relative',
|
||||
'payment_term_last_1': '',
|
||||
'payment_term_last_2': '10',
|
||||
'payment_term_last_3': 'date_from',
|
||||
'payment_term_last_3': 'event__date_from',
|
||||
'tax_rule_payment': 'default',
|
||||
})
|
||||
assert doc.select('.alert-danger')
|
||||
|
||||
Reference in New Issue
Block a user