forked from CGM_Public/pretix_original
Compare commits
5 Commits
migration-
...
metrics_mi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a425377cae | ||
|
|
af3418db54 | ||
|
|
ca8d253114 | ||
|
|
f014a9bbd3 | ||
|
|
3e5bfb44d2 |
@@ -1025,10 +1025,9 @@ class BaseInvoiceAddressForm(forms.ModelForm):
|
||||
'autocomplete': 'address-level2',
|
||||
}),
|
||||
'company': forms.TextInput(attrs={
|
||||
'data-display-dependency': '#id_is_business_1',
|
||||
'autocomplete': 'organization',
|
||||
}),
|
||||
'vat_id': forms.TextInput(attrs={'data-display-dependency': '#id_is_business_1'}),
|
||||
'vat_id': forms.TextInput(),
|
||||
'internal_reference': forms.TextInput,
|
||||
}
|
||||
labels = {
|
||||
@@ -1059,10 +1058,8 @@ class BaseInvoiceAddressForm(forms.ModelForm):
|
||||
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
# If an individual or company address is acceptable, #id_is_business_0 == individual, _1 == company.
|
||||
# However, if only company addresses are acceptable, #id_is_business_0 == company and is the only choice
|
||||
self.fields["company"].widget.attrs["data-display-dependency"] = f'#id_{self.add_prefix("is_business")}_{int(not self.company_required)}'
|
||||
self.fields["vat_id"].widget.attrs["data-display-dependency"] = f'#id_{self.add_prefix("is_business")}_{int(not self.company_required)}'
|
||||
self.fields["company"].widget.attrs["data-display-dependency"] = f'input[name="{self.add_prefix("is_business")}"][value="business"]'
|
||||
self.fields["vat_id"].widget.attrs["data-display-dependency"] = f'input[name="{self.add_prefix("is_business")}"][value="business"]'
|
||||
|
||||
if not self.ask_vat_id:
|
||||
del self.fields['vat_id']
|
||||
@@ -1143,9 +1140,9 @@ class BaseInvoiceAddressForm(forms.ModelForm):
|
||||
)
|
||||
if self.address_required and not self.company_required and not self.all_optional:
|
||||
if not event.settings.invoice_name_required:
|
||||
self.fields['name_parts'].widget.attrs['data-required-if'] = f'#id_{self.add_prefix("is_business")}_0'
|
||||
self.fields['name_parts'].widget.attrs['data-required-if'] = f'input[name="{self.add_prefix("is_business")}"][value="individual"]'
|
||||
self.fields['name_parts'].widget.attrs['data-no-required-attr'] = '1'
|
||||
self.fields['company'].widget.attrs['data-required-if'] = f'#id_{self.add_prefix("is_business")}_1'
|
||||
self.fields['company'].widget.attrs['data-required-if'] = f'input[name="{self.add_prefix("is_business")}"][value="business"]'
|
||||
|
||||
if not event.settings.invoice_address_beneficiary:
|
||||
del self.fields['beneficiary']
|
||||
|
||||
@@ -13,6 +13,6 @@ class Migration(migrations.Migration):
|
||||
migrations.AddField(
|
||||
model_name="item",
|
||||
name="hidden_if_item_available_mode",
|
||||
field=models.CharField(default="hide", max_length=16, null=True),
|
||||
field=models.CharField(default="hide", max_length=16),
|
||||
),
|
||||
]
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# Generated by Django 4.2.16 on 2025-01-24 12:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
("pretixbase", "0276_item_hidden_if_item_available_mode"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name="item",
|
||||
name="hidden_if_item_available_mode",
|
||||
field=models.CharField(default="hide", max_length=16),
|
||||
),
|
||||
]
|
||||
@@ -338,7 +338,7 @@ class CheckinErrorLogEntryType(OrderLogEntryType):
|
||||
else:
|
||||
data['list'] = _("(unknown)")
|
||||
|
||||
data['barcode'] = data.get('barcode')[:16]
|
||||
data['barcode'] = data.get('barcode', '')[:16]
|
||||
data['posid'] = logentry.parsed_data.get('positionid', '?')
|
||||
|
||||
if 'datetime' in data:
|
||||
@@ -529,7 +529,7 @@ class VoucherRedeemedLogEntryType(VoucherLogEntryType):
|
||||
})
|
||||
return format_html(
|
||||
self.plain,
|
||||
order_code=format_html('<a href="{}">{}</a>', url, data('order_code', '?')),
|
||||
order_code=format_html('<a href="{}">{}</a>', url, data.get('order_code', '?')),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -62,7 +62,8 @@ class MetricsMiddleware(object):
|
||||
t0 = time.perf_counter()
|
||||
resp = self.get_response(request)
|
||||
tdiff = time.perf_counter() - t0
|
||||
pretix_view_duration_seconds.observe(tdiff, status_code=resp.status_code, method=request.method,
|
||||
url_name=url.namespace + ':' + url.url_name)
|
||||
if url.url_name:
|
||||
pretix_view_duration_seconds.observe(tdiff, status_code=resp.status_code, method=request.method,
|
||||
url_name=url.namespace + ':' + url.url_name)
|
||||
|
||||
return resp
|
||||
|
||||
@@ -51,8 +51,8 @@ def register_payment_provider(sender, **kwargs):
|
||||
class PaypalEventLogEntryType(EventLogEntryType):
|
||||
action_type = 'pretix.plugins.paypal.event'
|
||||
|
||||
def display(self, logentry):
|
||||
event_type = logentry.parsed_data.get('event_type')
|
||||
def display(self, logentry, data):
|
||||
event_type = data.get('event_type')
|
||||
text = None
|
||||
plains = {
|
||||
'PAYMENT.SALE.COMPLETED': _('Payment completed.'),
|
||||
|
||||
Reference in New Issue
Block a user