mirror of
https://github.com/pretix/pretix.git
synced 2026-01-05 21:32:26 +00:00
Compare commits
12 Commits
mf0aes-doc
...
v2023.7.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
34d1d3fa6e | ||
|
|
ccdce2ccb8 | ||
|
|
6d834762c4 | ||
|
|
4f1e9a31c6 | ||
|
|
8ed3911dfb | ||
|
|
4562879cb2 | ||
|
|
ef0024b2ef | ||
|
|
8e603410fa | ||
|
|
16691ca2f6 | ||
|
|
d7e70fd0b9 | ||
|
|
071a3e2c9b | ||
|
|
1733c383b3 |
@@ -19,4 +19,4 @@
|
||||
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
|
||||
# <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
__version__ = "2023.7.0.dev0"
|
||||
__version__ = "2023.7.1"
|
||||
|
||||
@@ -907,6 +907,11 @@ class Order(LockModel, LoggedModel):
|
||||
return self.expires
|
||||
|
||||
expires = self.expires.date() + timedelta(days=delay)
|
||||
if self.event.settings.get('payment_term_weekdays'):
|
||||
if expires.weekday() == 5:
|
||||
expires += timedelta(days=2)
|
||||
elif expires.weekday() == 6:
|
||||
expires += timedelta(days=1)
|
||||
|
||||
tz = ZoneInfo(self.event.settings.timezone)
|
||||
expires = make_aware(datetime.combine(
|
||||
|
||||
@@ -941,9 +941,9 @@ DEFAULTS = {
|
||||
'form_kwargs': dict(
|
||||
label=_('Expiration delay'),
|
||||
help_text=_("The order will only actually expire this many days after the expiration date communicated "
|
||||
"to the customer. However, this will not delay beyond the \"last date of payments\" "
|
||||
"configured above, which is always enforced. The delay may also end on a weekend regardless "
|
||||
"of the other settings above."),
|
||||
"to the customer. If you select \"Only end payment terms on weekdays\" above, this will also "
|
||||
"be respected. However, this will not delay beyond the \"last date of payments\" "
|
||||
"configured above, which is always enforced."),
|
||||
# Every order in between the official expiry date and the delayed expiry date has a performance penalty
|
||||
# for the cron job, so we limit this feature to 30 days to prevent arbitrary numbers of orders needing
|
||||
# to be checked.
|
||||
|
||||
@@ -187,7 +187,7 @@
|
||||
{% endif %}
|
||||
{% for f in plugin_forms %}
|
||||
{% if f.is_layouts and not f.title %}
|
||||
{% if f.template %}
|
||||
{% if f.template and not "template" in f.fields %}
|
||||
{% include f.template with form=f %}
|
||||
{% else %}
|
||||
{% bootstrap_form f layout="control" %}
|
||||
@@ -261,7 +261,7 @@
|
||||
{% bootstrap_field form.show_quota_left layout="control" %}
|
||||
{% for f in plugin_forms %}
|
||||
{% if not f.is_layouts and not f.title %}
|
||||
{% if f.template %}
|
||||
{% if f.template and not "template" in f.fields %}
|
||||
{% include f.template with form=f %}
|
||||
{% else %}
|
||||
{% bootstrap_form f layout="control" %}
|
||||
@@ -273,7 +273,7 @@
|
||||
{% if not f.is_layouts and f.title %}
|
||||
<fieldset>
|
||||
<legend>{{ f.title }}</legend>
|
||||
{% if f.template %}
|
||||
{% if f.template and not "template" in f.fields %}
|
||||
{% include f.template with form=f %}
|
||||
{% else %}
|
||||
{% bootstrap_form f layout="control" %}
|
||||
|
||||
@@ -783,8 +783,8 @@ class MailSettingsRendererPreview(MailSettingsPreview):
|
||||
return ctx
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
v = str(request.event.settings.mail_text_order_placed)
|
||||
v = format_map(v, self.placeholders('mail_text_order_placed'))
|
||||
v = str(request.event.settings.mail_text_order_payment_failed)
|
||||
v = format_map(v, self.placeholders('mail_text_order_payment_failed'))
|
||||
renderers = request.event.get_html_mail_renderers()
|
||||
if request.GET.get('renderer') in renderers:
|
||||
with rolledback_transaction():
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2023-07-21 13:02+0000\n"
|
||||
"POT-Creation-Date: 2023-07-27 11:50+0000\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -5,9 +5,9 @@
|
||||
<div class="panel panel-default items">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<strong>{{ position.item }}</strong>
|
||||
<strong>{{ position.item.name }}</strong>
|
||||
{% if position.variation %}
|
||||
– {{ position.variation }}
|
||||
– {{ position.variation.value }}
|
||||
{% endif %}
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
@@ -188,13 +188,13 @@ if SITE_URL.endswith('/'):
|
||||
|
||||
CSRF_TRUSTED_ORIGINS = [urlparse(SITE_URL).scheme + '://' + urlparse(SITE_URL).hostname]
|
||||
|
||||
TRUST_X_FORWARDED_FOR = config.get('pretix', 'trust_x_forwarded_for', fallback=False)
|
||||
USE_X_FORWARDED_HOST = config.get('pretix', 'trust_x_forwarded_host', fallback=False)
|
||||
TRUST_X_FORWARDED_FOR = config.getboolean('pretix', 'trust_x_forwarded_for', fallback=False)
|
||||
USE_X_FORWARDED_HOST = config.getboolean('pretix', 'trust_x_forwarded_host', fallback=False)
|
||||
|
||||
|
||||
REQUEST_ID_HEADER = config.get('pretix', 'request_id_header', fallback=False)
|
||||
|
||||
if config.get('pretix', 'trust_x_forwarded_proto', fallback=False):
|
||||
if config.getboolean('pretix', 'trust_x_forwarded_proto', fallback=False):
|
||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||
|
||||
PRETIX_PLUGINS_DEFAULT = config.get('pretix', 'plugins_default',
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -43,7 +43,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -73,7 +73,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -110,7 +110,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -122,7 +122,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -138,7 +138,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -150,7 +150,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -188,7 +188,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -200,7 +200,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -212,7 +212,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -247,7 +247,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -259,7 +259,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -307,7 +307,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -339,7 +339,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -351,7 +351,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -371,7 +371,7 @@
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[0-9]+(\\.[0-9]+)?$"
|
||||
"pattern": "^-?[0-9]+(\\.[0-9]+)?$"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -412,6 +412,7 @@ def test_expiring_auto_disabled(event):
|
||||
def test_expiring_auto_delayed(event):
|
||||
event.settings.set('payment_term_expire_delay_days', 3)
|
||||
event.settings.set('payment_term_last', date(2023, 7, 2))
|
||||
event.settings.set('payment_term_weekdays', False)
|
||||
event.settings.set('timezone', 'Europe/Berlin')
|
||||
o1 = Order.objects.create(
|
||||
code='FOO', event=event, email='dummy@dummy.test',
|
||||
@@ -458,6 +459,21 @@ def test_expiring_auto_delayed(event):
|
||||
assert o2.status == Order.STATUS_EXPIRED
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_expiring_auto_delayed_weekdays(event):
|
||||
event.settings.set('payment_term_expire_delay_days', 2)
|
||||
event.settings.set('payment_term_weekdays', True)
|
||||
event.settings.set('timezone', 'Europe/Berlin')
|
||||
o1 = Order.objects.create(
|
||||
code='FOO', event=event, email='dummy@dummy.test',
|
||||
status=Order.STATUS_PENDING,
|
||||
datetime=datetime(2023, 6, 22, 12, 13, 14, tzinfo=zoneinfo.ZoneInfo("Europe/Berlin")),
|
||||
expires=datetime(2023, 6, 30, 23, 59, 59, tzinfo=zoneinfo.ZoneInfo("Europe/Berlin")),
|
||||
total=0,
|
||||
)
|
||||
assert o1.payment_term_expire_date == o1.expires + timedelta(days=3)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_do_not_expire_if_approval_pending(event):
|
||||
o1 = Order.objects.create(
|
||||
|
||||
Reference in New Issue
Block a user