Compare commits

..

7 Commits

Author SHA1 Message Date
Raphael Michel
1752e2a9db Order change: Fix list of unchangeable add-ons not filtered to category (Z#23223330) 2026-02-05 15:26:11 +01:00
Raphael Michel
dc49d5bcf7 Add "scheduling" to banned organizer slugs 2026-02-03 12:51:48 +01:00
Richard Schreiber
d4460045b4 Fix mail headers being None (#5873)
* Fix mail headers being None

* update tests
2026-02-03 11:26:26 +01:00
dependabot[bot]
cead2898a7 Bump @babel/preset-env from 7.28.5 to 7.29.0 in /src/pretix/static/npm_dir (#5867)
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.28.5 to 7.29.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.29.0/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-version: 7.29.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-02 13:43:13 +01:00
Raphael Michel
6a594a6166 Metrics: Fix length and age of of queues (broken after #5513) (#5865) 2026-02-02 13:37:16 +01:00
Raphael Michel
0e7bb43a5a Manual payment: Fix using hidden method for existing order (#5850) 2026-02-02 12:32:53 +01:00
Richard Schreiber
3a3ae6e66c Fix custom pycountry_add index handling (#5869) 2026-02-02 09:41:32 +01:00
12 changed files with 738 additions and 754 deletions

View File

@@ -294,14 +294,28 @@ def metric_values():
channel = app.broker_connection().channel()
if hasattr(channel, 'client') and channel.client is not None:
client = channel.client
priority_steps = settings.CELERY_BROKER_TRANSPORT_OPTIONS.get("priority_steps", [0])
sep = settings.CELERY_BROKER_TRANSPORT_OPTIONS.get("sep", ":")
for q in settings.CELERY_TASK_QUEUES:
llen = client.llen(q.name)
lfirst = client.lindex(q.name, -1)
metrics['pretix_celery_tasks_queued_count']['{queue="%s"}' % q.name] = llen
if lfirst:
ldata = json.loads(lfirst)
dt = time.time() - ldata.get('created', 0)
metrics['pretix_celery_tasks_queued_age_seconds']['{queue="%s"}' % q.name] = dt
queue_lengths = []
queue_delays = []
for prio in priority_steps:
if prio:
qname = f"{q.name}{sep}{prio}"
else:
qname = q.name
queue_length = client.llen(qname)
queue_lengths.append(queue_length)
oldest_queue_item = client.lindex(qname, -1)
if oldest_queue_item:
ldata = json.loads(oldest_queue_item)
oldest_item_age = time.time() - ldata.get('created', 0)
queue_delays.append(oldest_item_age)
metrics['pretix_celery_tasks_queued_count']['{queue="%s"}' % q.name] = sum(queue_lengths)
if queue_delays:
metrics['pretix_celery_tasks_queued_age_seconds']['{queue="%s"}' % q.name] = max(queue_delays)
else:
metrics['pretix_celery_tasks_queued_age_seconds']['{queue="%s"}' % q.name] = 0

View File

@@ -1231,8 +1231,8 @@ class ManualPayment(BasePaymentProvider):
def is_allowed(self, request: HttpRequest, total: Decimal=None):
return 'pretix.plugins.manualpayment' in self.event.plugins and super().is_allowed(request, total)
def order_change_allowed(self, order: Order):
return 'pretix.plugins.manualpayment' in self.event.plugins and super().order_change_allowed(order)
def order_change_allowed(self, order: Order, request=None):
return 'pretix.plugins.manualpayment' in self.event.plugins and super().order_change_allowed(order, request)
@property
def public_name(self):

View File

@@ -321,7 +321,7 @@ def mail(email: Union[str, Sequence[str]], subject: str, template: Union[str, La
body_plain=body_plain,
body_html=body_html,
sender=sender,
headers=headers,
headers=headers or {},
should_attach_tickets=attach_tickets,
should_attach_ical=attach_ical,
should_attach_other_files=attach_other_files or [],
@@ -763,7 +763,7 @@ def mail_send(to: List[str], subject: str, body: str, html: Optional[str], sende
body_plain=body,
body_html=html,
sender=sender,
headers=headers,
headers=headers or {},
should_attach_tickets=attach_tickets,
should_attach_ical=attach_ical,
should_attach_other_files=attach_other_files or [],

View File

@@ -95,6 +95,7 @@ class OrganizerSlugBanlistValidator(BanlistValidator):
'csp_report',
'widget',
'lead',
'scheduling',
]

View File

@@ -19,7 +19,7 @@
<dl class="dl-horizontal">
<dt>{% trans "From" context "email" %}</dt>
<dd>{{ sender }}</dd>
<dd>{{ mail.sender }}</dd>
<dt>{% trans "To" context "email" %}</dt>
<dd>{{ mail.to|join:", " }}</dd>
{% if mail.cc %}

View File

@@ -21,8 +21,6 @@
#
import base64
import logging
from email.header import decode_header, make_header
from email.utils import parseaddr
from django.conf import settings
from django.contrib import messages
@@ -126,12 +124,6 @@ class OutgoingMailDetailView(OrganizerDetailViewMixin, OrganizerPermissionRequir
ctx = super().get_context_data(**kwargs)
if self.object.body_html:
ctx['data_url'] = "data:text/html;charset=utf-8;base64," + base64.b64encode(self.object.body_html.encode()).decode()
from_name, from_email = parseaddr(self.object.sender)
if from_name:
from_name = make_header(decode_header(from_name))
ctx['sender'] = "{} <{}>".format(from_name, from_email) if from_name else from_email
return ctx

View File

@@ -148,4 +148,7 @@ def pycountry_add(db, **kw):
continue
value = value.lower()
index = db.indices.setdefault(key, {})
index.setdefault(value, set()).add(obj)
if key in ["country_code"]:
index.setdefault(value, set()).add(obj)
else:
index[value] = obj

View File

@@ -1510,7 +1510,10 @@ class OrderChangeMixin:
'max_count': iao.max_count,
'iao': iao,
'items': [i for i in items if not i.require_voucher],
'items_missing': {k: v for k, v in current_addon_products_missing.items() if v},
'items_missing': {
k: v for k, v in current_addon_products_missing.items()
if v and k[0].category_id == iao.addon_category_id
},
})
return positions

View File

@@ -97,7 +97,8 @@ class UnlockHashView(EventViewMixin, View):
def get(self, request, *args, **kwargs):
hashes = request.session.get('pretix_unlock_hashes', [])
hashes.append(kwargs.get('hash'))
if kwargs.get('hash') not in hashes:
hashes.append(kwargs.get('hash'))
request.session['pretix_unlock_hashes'] = hashes
if 'voucher' in request.GET:

File diff suppressed because it is too large Load Diff

View File

@@ -5,7 +5,7 @@
"scripts": {},
"dependencies": {
"@babel/core": "^7.28.5",
"@babel/preset-env": "^7.28.5",
"@babel/preset-env": "^7.29.0",
"@rollup/plugin-babel": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"vue": "^2.7.16",

View File

@@ -170,7 +170,6 @@ def test_queue_state_sent(env):
subject='Test',
body_plain='Test',
sender='sender@example.com',
headers={},
)
assert m.status == OutgoingMail.STATUS_QUEUED
mail_send_task.apply(kwargs={
@@ -188,7 +187,6 @@ def test_queue_state_permanent_failure(env):
subject='Test',
body_plain='Test',
sender='sender@example.com',
headers={},
)
assert m.status == OutgoingMail.STATUS_QUEUED
mail_send_task.apply(kwargs={
@@ -210,7 +208,6 @@ def test_queue_state_retry_failure(env, monkeypatch):
subject='Test',
body_plain='Test',
sender='sender@example.com',
headers={},
)
assert m.status == OutgoingMail.STATUS_QUEUED
mail_send_task.apply(kwargs={
@@ -236,7 +233,6 @@ def test_queue_state_foreign_key_handling():
subject='Test',
body_plain='Test',
sender='sender@example.com',
headers={},
)
mail_sent = OutgoingMail.objects.create(
organizer=o,
@@ -245,7 +241,6 @@ def test_queue_state_foreign_key_handling():
subject='Test',
body_plain='Test',
sender='sender@example.com',
headers={},
status=OutgoingMail.STATUS_SENT,
)