mirror of
https://github.com/pretix/pretix.git
synced 2026-07-11 06:11:54 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d18e8391a | |||
| cead2898a7 | |||
| 6a594a6166 | |||
| 0e7bb43a5a | |||
| 3a3ae6e66c |
@@ -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
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -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 [],
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
+700
-725
File diff suppressed because it is too large
Load Diff
@@ -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",
|
||||
|
||||
@@ -674,10 +674,11 @@ var editor = {
|
||||
$("#toolbox").find("button[data-action=middle]").toggleClass('active', o.verticalAlign === 'middle');
|
||||
$("#toolbox").find("button[data-action=bottom]").toggleClass('active', o.verticalAlign === 'bottom');
|
||||
|
||||
console.log("_update_toolbox_values", o.scaleY, o.scaleX)
|
||||
if (o.scaleY !== 1 || o.scaleX !== 1) {
|
||||
o.set({
|
||||
height: o.height * o.scaleY,
|
||||
width: o.width * o.scaleX,
|
||||
height: Math.max(o.height * o.scaleY, editor._mm2px(10.01)),
|
||||
width: Math.max(o.width * o.scaleX, editor._mm2px(10.01)),
|
||||
scaleX: 1,
|
||||
scaleY: 1
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user