Compare commits

..

1 Commits

Author SHA1 Message Date
Raphael Michel
df656d1580 Avoid showing empty add-on step (Z#23167007)
Do not show add-on step if none of the add-on items is available. This
is not a perfect solution, there are still cases where an empty add-on
step will show up, e.g.:

- Products disabled only for a specific subevent
- Sold-out add-ons combined with the "hide sold-out products" flag
2024-09-27 13:44:42 +02:00
11 changed files with 787 additions and 1073 deletions

View File

@@ -66,7 +66,7 @@ To build and run pretix, you will need the following debian packages::
# apt-get install git build-essential python3-dev python3-venv python3 python3-pip \
libxml2-dev libxslt1-dev libffi-dev zlib1g-dev libssl-dev \
gettext libpq-dev libjpeg-dev libopenjp2-7-dev 2to3
gettext libpq-dev libjpeg-dev libopenjp2-7-dev
Config file
-----------

View File

@@ -80,18 +80,18 @@ dependencies = [
"psycopg2-binary",
"pycountry",
"pycparser==2.22",
"pycryptodome==3.21.*",
"pycryptodome==3.20.*",
"pypdf==5.0.*",
"python-bidi==0.6.*", # Support for Arabic in reportlab
"python-dateutil==2.9.*",
"pytz",
"pytz-deprecation-shim==0.1.*",
"pyuca",
"qrcode==8.0",
"redis==5.1.*",
"qrcode==7.4.*",
"redis==5.0.*",
"reportlab==4.2.*",
"requests==2.31.*",
"sentry-sdk==2.15.*",
"sentry-sdk==2.14.*",
"sepaxml==2.6.*",
"slimit",
"stripe==7.9.*",

View File

@@ -313,38 +313,9 @@ class EventMixin:
items=GroupConcat('pk', delimiter=',')
).values('items')
q_variation = (
Q(active=True)
& Q(Q(available_from__isnull=True) | Q(available_from__lte=time_machine_now()))
& Q(Q(available_until__isnull=True) | Q(available_until__gte=time_machine_now()))
& Q(item__active=True)
& Q(Q(item__available_from__isnull=True) | Q(item__available_from__lte=time_machine_now()))
& Q(Q(item__available_until__isnull=True) | Q(item__available_until__gte=time_machine_now()))
& Q(Q(item__category__isnull=True) | Q(item__category__is_addon=False))
& Q(item__require_bundling=False)
& Q(quotas__pk=OuterRef('pk'))
)
if isinstance(channel, str):
q_variation &= Q(Q(all_sales_channels=True) | Q(limit_sales_channels__identifier=channel))
q_variation &= Q(Q(item__all_sales_channels=True) | Q(item__limit_sales_channels__identifier=channel))
else:
q_variation &= Q(Q(all_sales_channels=True) | Q(limit_sales_channels=channel))
q_variation &= Q(Q(item__all_sales_channels=True) | Q(item__limit_sales_channels=channel))
if voucher:
if voucher.variation_id:
q_variation &= Q(pk=voucher.variation_id)
elif voucher.item_id:
q_variation &= Q(item_id=voucher.item_id)
elif voucher.quota_id:
q_variation &= Q(quotas__in=[voucher.quota_id])
if not voucher or not voucher.show_hidden_items:
q_variation &= Q(hide_without_voucher=False)
q_variation &= Q(item__hide_without_voucher=False)
sq_active_variation = ItemVariation.objects.filter(q_variation).order_by().values_list('quotas__pk').annotate(
sq_active_variation = ItemVariation.objects.filter_available(channel=channel, voucher=voucher).filter(
Q(quotas__pk=OuterRef('pk'))
).order_by().values_list('quotas__pk').annotate(
items=GroupConcat('pk', delimiter=',')
).values('items')
quota_base_qs = Quota.objects.using(settings.DATABASE_REPLICA).filter(

View File

@@ -303,6 +303,48 @@ def filter_available(qs, channel='web', voucher=None, allow_addons=False):
return qs.filter(q)
def filter_variations_available(qs, channel='web', voucher=None, allow_addons=False):
# Channel can currently be a SalesChannel or a str, since we need that compatibility, but a SalesChannel
# makes the query SIGNIFICANTLY faster
from .organizer import SalesChannel
assert isinstance(channel, (SalesChannel, str))
q = (
Q(active=True)
& Q(Q(available_from__isnull=True) | Q(available_from__lte=time_machine_now()))
& Q(Q(available_until__isnull=True) | Q(available_until__gte=time_machine_now()))
& Q(item__active=True)
& Q(Q(item__available_from__isnull=True) | Q(item__available_from__lte=time_machine_now()))
& Q(Q(item__available_until__isnull=True) | Q(item__available_until__gte=time_machine_now()))
& Q(Q(item__category__isnull=True) | Q(item__category__is_addon=False))
& Q(item__require_bundling=False)
)
if isinstance(channel, str):
q &= Q(Q(all_sales_channels=True) | Q(limit_sales_channels__identifier=channel))
q &= Q(Q(item__all_sales_channels=True) | Q(item__limit_sales_channels__identifier=channel))
else:
q &= Q(Q(all_sales_channels=True) | Q(limit_sales_channels=channel))
q &= Q(Q(item__all_sales_channels=True) | Q(item__limit_sales_channels=channel))
if not allow_addons:
q &= Q(Q(item__category__isnull=True) | Q(item__category__is_addon=False))
if voucher:
if voucher.variation_id:
q &= Q(pk=voucher.variation_id)
elif voucher.item_id:
q &= Q(item_id=voucher.item_id)
elif voucher.quota_id:
q &= Q(quotas__in=[voucher.quota_id])
if not voucher or not voucher.show_hidden_items:
q &= Q(hide_without_voucher=False)
q &= Q(item__hide_without_voucher=False)
return qs.filter(q)
class ItemQuerySet(models.QuerySet):
def filter_available(self, channel='web', voucher=None, allow_addons=False):
return filter_available(self, channel, voucher, allow_addons)
@@ -317,6 +359,20 @@ class ItemQuerySetManager(ScopedManager(organizer='event__organizer').__class__)
return filter_available(self.get_queryset(), channel, voucher, allow_addons)
class ItemVariationQuerySet(models.QuerySet):
def filter_available(self, channel='web', voucher=None, allow_addons=False):
return filter_variations_available(self, channel, voucher, allow_addons)
class ItemVariationQuerySetManager(ScopedManager(organizer='item__event__organizer').__class__):
def __init__(self):
super().__init__()
self._queryset_class = ItemVariationQuerySet
def filter_available(self, channel='web', voucher=None, allow_addons=False):
return filter_variations_available(self.get_queryset(), channel, voucher, allow_addons)
class Item(LoggedModel):
"""
An item is a thing which can be sold. It belongs to an event and may or may not belong to a category.
@@ -1199,7 +1255,7 @@ class ItemVariation(models.Model):
help_text=_('This text will be shown by the check-in app if a ticket of this type is scanned.')
)
objects = ScopedManager(organizer='item__event__organizer')
objects = ItemVariationQuerySetManager()
class Meta:
verbose_name = _("Product variation")

View File

@@ -103,7 +103,7 @@ def timeline_for_event(event, subevent=None):
tl.append(TimelineEvent(
event=event, subevent=subevent,
datetime=rd.datetime(ev),
description=pgettext_lazy('timeline', 'Customers can no longer modify their order information'),
description=pgettext_lazy('timeline', 'Customers can no longer modify their orders'),
edit_url=ev_edit_url
))
@@ -159,18 +159,6 @@ def timeline_for_event(event, subevent=None):
})
))
rd = event.settings.get('change_allow_user_until', as_type=RelativeDateWrapper)
if rd and event.settings.change_allow_user_until:
tl.append(TimelineEvent(
event=event, subevent=subevent,
datetime=rd.datetime(ev),
description=pgettext_lazy('timeline', 'Customers can no longer make changes to their orders'),
edit_url=reverse('control:event.settings.cancel', kwargs={
'event': event.slug,
'organizer': event.organizer.slug
})
))
rd = event.settings.get('waiting_list_auto_disable', as_type=RelativeDateWrapper)
if rd and event.settings.waiting_list_enabled:
tl.append(TimelineEvent(

View File

@@ -21,11 +21,6 @@
{% trans "The waiting list is no longer active for this event. The waiting list no longer affects quotas and no longer notifies waiting users." %}
</div>
{% endif %}
{% if request.event.settings.hide_sold_out %}
<div class="alert alert-warning">
{% trans "According to your event settings, sold out products are hidden from customers. This way, customers will not be able to discovere the waiting list." %}
</div>
{% endif %}
<div class="row">
{% if 'can_change_orders' in request.eventpermset %}
<form method="post" class="col-md-6"

File diff suppressed because it is too large Load Diff

View File

@@ -8,16 +8,16 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-08-27 13:34+0000\n"
"PO-Revision-Date: 2024-10-01 22:52+0000\n"
"Last-Translator: Patrick Chilton <chpatrick@gmail.com>\n"
"Language-Team: Hungarian <https://translate.pretix.eu/projects/pretix/"
"pretix-js/hu/>\n"
"PO-Revision-Date: 2020-01-24 08:00+0000\n"
"Last-Translator: Prokaj Miklós <mixolid0@gmail.com>\n"
"Language-Team: Hungarian <https://translate.pretix.eu/projects/pretix/pretix-"
"js/hu/>\n"
"Language: hu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.7.2\n"
"X-Generator: Weblate 3.5.1\n"
#: pretix/plugins/banktransfer/static/pretixplugins/banktransfer/ui.js:56
#: pretix/plugins/banktransfer/static/pretixplugins/banktransfer/ui.js:62
@@ -134,6 +134,9 @@ msgstr ""
#: pretix/plugins/paypal2/static/pretixplugins/paypal2/pretix-paypal.js:167
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:50
#, fuzzy
#| msgctxt "widget"
#| msgid "Continue"
msgid "Continue"
msgstr "Folytatás"
@@ -170,7 +173,7 @@ msgstr "Kapcsolatfelvétel Stripe-pal…"
#: pretix/plugins/stripe/static/pretixplugins/stripe/pretix-stripe.js:72
msgid "Total"
msgstr "Összeg"
msgstr "Teljes"
#: pretix/plugins/stripe/static/pretixplugins/stripe/pretix-stripe.js:291
msgid "Contacting your bank …"
@@ -238,7 +241,7 @@ msgstr ""
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:44
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:45
msgid "Canceled"
msgstr "Lemondva"
msgstr ""
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:46
msgid "Confirmed"
@@ -246,7 +249,7 @@ msgstr ""
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:47
msgid "Approval pending"
msgstr "Engedélyre vár"
msgstr ""
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:48
#, fuzzy
@@ -257,7 +260,7 @@ msgstr "Beváltás"
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:49
msgid "Cancel"
msgstr "Lemondás"
msgstr ""
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:51
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:60
@@ -270,7 +273,7 @@ msgstr ""
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:53
msgid "Additional information required"
msgstr "Több információ szükséges"
msgstr ""
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:54
msgid "Valid ticket"
@@ -286,7 +289,7 @@ msgstr ""
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:57
msgid "Information required"
msgstr "Információ szükséges"
msgstr ""
#: pretix/plugins/webcheckin/static/pretixplugins/webcheckin/main.js:58
#, fuzzy
@@ -468,7 +471,7 @@ msgstr ""
#: pretix/static/pretixcontrol/js/ui/checkinrules.js:99
msgid "Product"
msgstr "Termék"
msgstr ""
#: pretix/static/pretixcontrol/js/ui/checkinrules.js:103
#, fuzzy
@@ -727,12 +730,12 @@ msgstr[0] "(még egy időpont)"
msgstr[1] "(még {num} időpont)"
#: pretix/static/pretixpresale/js/ui/cart.js:43
#, fuzzy
#| msgid "The items in your cart are no longer reserved for you."
msgid ""
"The items in your cart are no longer reserved for you. You can still "
"complete your order as long as theyre available."
msgstr ""
"A kosárba helyezett tételek tovább már nincsenek lefoglalva. Még "
"megpróbálhatod befejezni a rendelést, ha még elérhetőek."
msgstr "A kosárba helyezett termékek tovább nincsenek tovább foglalva."
#: pretix/static/pretixpresale/js/ui/cart.js:45
msgid "Cart expired"

View File

@@ -8,8 +8,8 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-26 11:22+0000\n"
"PO-Revision-Date: 2024-09-30 05:00+0000\n"
"Last-Translator: Rosariocastellana <rosariocastellana@gmail.com>\n"
"PO-Revision-Date: 2024-08-22 15:00+0000\n"
"Last-Translator: Michelangelo <michelangelo.morrillo@gmail.com>\n"
"Language-Team: Italian <https://translate.pretix.eu/projects/pretix/pretix/"
"it/>\n"
"Language: it\n"
@@ -17,7 +17,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.7.2\n"
"X-Generator: Weblate 5.7\n"
#: pretix/_base_settings.py:79
msgid "English"
@@ -37,7 +37,7 @@ msgstr "Arabo"
#: pretix/_base_settings.py:83
msgid "Basque"
msgstr "Basco"
msgstr ""
#: pretix/_base_settings.py:84
msgid "Catalan"
@@ -121,7 +121,7 @@ msgstr "Russo"
#: pretix/_base_settings.py:104
msgid "Slovak"
msgstr "Slovacco"
msgstr ""
#: pretix/_base_settings.py:105
msgid "Swedish"
@@ -31767,7 +31767,7 @@ msgstr ""
#: pretix/presale/templates/pretixpresale/organizers/index.html:25
msgid "Past events"
msgstr "Eventi passati"
msgstr ""
#: pretix/presale/templates/pretixpresale/organizers/index.html:27
msgid "Upcoming events"
@@ -31832,7 +31832,7 @@ msgstr ""
#: pretix/presale/views/cart.py:190
msgid "Please enter positive numbers only."
msgstr "Inserisci solo numeri positivi."
msgstr ""
#: pretix/presale/views/cart.py:428
msgid "We applied the voucher to as many products in your cart as we could."
@@ -31901,12 +31901,11 @@ msgid ""
"Your email address has not been updated since the address is already in use "
"for another customer account."
msgstr ""
"Il tuo indirizzo email non è stato aggiornato perché è già in uso per un "
"altro account cliente."
#: pretix/presale/views/customer.py:576
#, fuzzy
msgid "Your email address has been updated."
msgstr "Il tuo indirizzo email è stato aggiornato."
msgstr "La tua gift card è stata applicata."
#: pretix/presale/views/customer.py:789 pretix/presale/views/customer.py:800
#, python-brace-format
@@ -31914,41 +31913,43 @@ msgid ""
"We were unable to use your login since the email address {email} is already "
"used for a different account in this system."
msgstr ""
"Non siamo riusciti a utilizzare le tue credenziali di accesso poiché "
"l'indirizzo email {email} è già utilizzato per un altro account in questo "
"sistema."
#: pretix/presale/views/event.py:890
msgid "Unknown event code or not authorized to access this event."
msgstr ""
"Codice evento sconosciuto o non autorizzato ad accedere a questo evento."
#: pretix/presale/views/event.py:897
msgctxt "subevent"
msgid "No date selected."
msgstr "Nessuna data selezionata."
msgstr ""
#: pretix/presale/views/event.py:900
msgctxt "subevent"
msgid "Unknown date selected."
msgstr "Data selezionata sconosciuta."
msgstr ""
#: pretix/presale/views/event.py:925 pretix/presale/views/event.py:933
#: pretix/presale/views/event.py:936
msgid "Please go back and try again."
msgstr "Torna indietro e riprova."
msgstr ""
#: pretix/presale/views/event.py:949
#, fuzzy
#| msgid "Purchased"
msgid "Fake date time"
msgstr "Data e ora errati"
msgstr "Acquistato"
#: pretix/presale/views/event.py:961
#, fuzzy
#| msgid "Unknown order code or not authorized to access this order."
msgid "You are not allowed to access time machine mode."
msgstr "Non ti è consentito accedere alla modalità macchina del tempo."
msgstr "Numero di ordine sconosciuto oppure non autorizzato ad accedere."
#: pretix/presale/views/event.py:963
#, fuzzy
#| msgid "This gift card can only be used in test mode."
msgid "This feature is only available in test mode."
msgstr "This feature is only available in test mode."
msgstr "Questa gift card può essere utilizzata solo in modalità test."
#: pretix/presale/views/event.py:980
#, fuzzy
@@ -31966,16 +31967,17 @@ msgid "The payment is too late to be accepted."
msgstr "Il pagamento è troppo in ritardo per essere accettato."
#: pretix/presale/views/order.py:463
#, fuzzy
msgid "An invoice has been generated."
msgstr "È stata generata una fattura."
msgstr "Il dispositivo è statao creato."
#: pretix/presale/views/order.py:561
msgid "The payment method for this order cannot be changed."
msgstr "Il metodo di pagamento per questo ordine non può essere modificato."
msgstr ""
#: pretix/presale/views/order.py:572
msgid "A payment is currently pending for this order."
msgstr "Al momento è in sospeso un pagamento per questo ordine."
msgstr "Il pagamento è in attesa per questo ordine."
#: pretix/presale/views/order.py:853 pretix/presale/views/order.py:925
msgid "You cannot modify this order"
@@ -32002,8 +32004,6 @@ msgstr ""
#: pretix/presale/views/order.py:1119
msgid "Please click the link we sent you via email to download your tickets."
msgstr ""
"Clicca sul link che ti abbiamo inviato via email per scaricare i tuoi "
"biglietti."
#: pretix/presale/views/order.py:1600
#, python-brace-format
@@ -32011,28 +32011,22 @@ msgid ""
"The order has been changed. You can now proceed by paying the open amount of "
"{amount}."
msgstr ""
"L'ordine è stato modificato. Ora puoi procedere pagando l'importo scoperto "
"di {amount}."
#: pretix/presale/views/order.py:1612
msgid "You did not make any changes."
msgstr "Non hai apportato nessuna modifica."
msgstr ""
#: pretix/presale/views/order.py:1636
msgid "You may not change your order in a way that reduces the total price."
msgstr ""
"Non è possibile modificare l'ordine in modo da ridurre il prezzo totale."
#: pretix/presale/views/order.py:1638
msgid "You may only change your order in a way that increases the total price."
msgstr ""
"È possibile modificare l'ordine solo in modo da aumentare il prezzo totale."
#: pretix/presale/views/order.py:1640
msgid "You may not change your order in a way that changes the total price."
msgstr ""
"Non è possibile modificare l'ordine in modo tale da modificare il prezzo "
"totale."
#: pretix/presale/views/order.py:1642
msgid "You may not change your order in a way that would require a refund."
@@ -32061,14 +32055,10 @@ msgid ""
"{number} hours. If the email did not arrive, please check your spam folder "
"and also double check that you used the correct email address."
msgstr ""
"Se l'indirizzo email inserito è valido e associato a un ticket, ti abbiamo "
"già inviato un'email con un link al tuo ticket nelle ultime {number} ore. Se "
"l'email non è arrivata, controlla la cartella spam e verifica di aver "
"utilizzato l'indirizzo email corretto."
#: pretix/presale/views/user.py:91
msgid "We have trouble sending emails right now, please check back later."
msgstr "Al momento abbiamo problemi con l'invio delle email. Riprova più tardi."
msgstr ""
#: pretix/presale/views/user.py:94
msgid ""
@@ -32089,13 +32079,13 @@ msgid ""
msgstr ""
#: pretix/presale/views/waiting.py:141
#, python-brace-format
#, fuzzy, python-brace-format
msgid ""
"We've added you to the waiting list. We will send an email to {email} as "
"soon as this product gets available again."
msgstr ""
"Ti abbiamo aggiunto alla lista d'attesa. Ti invieremo un'email a {email} non "
"appena i biglietti saranno di nuovo disponibili."
"Ti abbiamo aggiunto alla lista d'attesa. Riceverai un'email non appena i "
"biglietti saranno di nuovo disponibili."
#: pretix/presale/views/waiting.py:169
msgid "We could not find you on our waiting list."
@@ -32139,7 +32129,7 @@ msgstr ""
#: pretix/settings.py:788
msgid "Write access"
msgstr "Accesso in scrittura"
msgstr ""
#: pretix/settings.py:799
msgid "Kosovo"

View File

@@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-09-26 11:22+0000\n"
"PO-Revision-Date: 2024-09-27 18:00+0000\n"
"PO-Revision-Date: 2024-08-28 10:03+0000\n"
"Last-Translator: Anarion Dunedain <anarion80@gmail.com>\n"
"Language-Team: Polish <https://translate.pretix.eu/projects/pretix/pretix/pl/"
">\n"
@@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 "
"|| n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 5.7.2\n"
"X-Generator: Weblate 5.7\n"
#: pretix/_base_settings.py:79
msgid "English"
@@ -38,7 +38,7 @@ msgstr "Arabski"
#: pretix/_base_settings.py:83
msgid "Basque"
msgstr "Baskijski"
msgstr ""
#: pretix/_base_settings.py:84
msgid "Catalan"
@@ -649,7 +649,7 @@ msgstr "Hasło"
#: pretix/base/auth.py:176 pretix/base/auth.py:183
msgid "Your password must contain both numeric and alphabetic characters."
msgstr "Twoje hasło musi zawierać znaki alfabetyczne i numeryczne."
msgstr ""
#: pretix/base/auth.py:202 pretix/base/auth.py:212
#, python-format
@@ -657,13 +657,9 @@ msgid "Your password may not be the same as your previous password."
msgid_plural ""
"Your password may not be the same as one of your %(history_length)s previous "
"passwords."
msgstr[0] "Twoje hasło nie może być takie samo jak poprzednie hasło."
msgstr[0] ""
msgstr[1] ""
"Twoje hasło nie może być takie samo jak jedno z twoich %(history_length)s "
"poprzednich haseł."
msgstr[2] ""
"Twoje hasło nie może być takie samo jak jedno z twoich %(history_length)s "
"poprzednich haseł."
#: pretix/base/channels.py:168
msgid "Online shop"
@@ -742,8 +738,6 @@ msgid ""
"No supported Token Endpoint Auth Methods supported: "
"{token_endpoint_auth_methods_supported}"
msgstr ""
"Brak wspieranych metod autentykacji tokena: "
"{token_endpoint_auth_methods_supported}"
#: pretix/base/customersso/oidc.py:203 pretix/base/customersso/oidc.py:210
#: pretix/base/customersso/oidc.py:229 pretix/base/customersso/oidc.py:246
@@ -6167,14 +6161,10 @@ msgid ""
"business customers in other EU countries in a way that works for all "
"organizers. Use custom rules instead."
msgstr ""
"Ta funkcja zostanie usunięta w przyszłości, ponieważ nie obsługuje podatku "
"VAT dla klientów niebędących firmami w innych krajach UE w sposób, który "
"działa dla wszystkich organizatorów. Zamiast tego należy użyć reguł "
"niestandardowych."
#: pretix/base/models/tax.py:204
msgid "DEPRECATED"
msgstr "WYCOFANY"
msgstr ""
#: pretix/base/models/tax.py:205
msgid ""
@@ -9547,15 +9537,19 @@ msgid "Show event times and dates on the ticket shop"
msgstr "Pokaż godziny i daty wydarzeń w sklepie z biletami"
#: pretix/base/settings.py:1297
#, fuzzy
#| msgid ""
#| "If disabled, no date or time will be shown on the ticket shop's front "
#| "page. This settings does however not affect the display in other "
#| "locations."
msgid ""
"If disabled, no date or time will be shown on the ticket shop's front page. "
"This settings also affects a few other locations, however it should not be "
"expected that the date of the event is shown nowhere to users."
msgstr ""
"Jeśli opcja ta jest wyłączona, data ani godzina nie będą wyświetlane na "
"stronie głównej sklepu z biletami. To ustawienie ma również wpływ na kilka "
"innych lokalizacji, jednak nie należy oczekiwać, że data wydarzenia nie "
"będzie nigdzie wyświetlana użytkownikom."
"Jeśli opcja ta zostanie wyłączona, na stronie głównej sklepu z biletami nie "
"będzie wyświetlana data ani godzina. To ustawienie nie ma jednak wpływu na "
"wyświetlanie w innych lokalizacjach."
#: pretix/base/settings.py:1308
msgid "Show event end date"
@@ -12998,12 +12992,16 @@ msgid "Subject (if order will not expire automatically)"
msgstr "Temat (jeśli zamówienie nie wygasa automatycznie)"
#: pretix/control/forms/event.py:1146
#, fuzzy
#| msgid "Incomplete payment received: {code}"
msgid "Subject (if an incomplete payment was received)"
msgstr "Temat (jeśli otrzymano niekompletną płatność)"
msgstr "Otrzymana niekompletna płatność: {code}"
#: pretix/control/forms/event.py:1151
#, fuzzy
#| msgid "Incomplete payment received: {code}"
msgid "Text (if an incomplete payment was received)"
msgstr "Tekst (jeśli otrzymano niekompletną płatność)"
msgstr "Otrzymana niekompletna płatność: {code}"
#: pretix/control/forms/event.py:1154
msgid ""
@@ -19329,8 +19327,10 @@ msgstr ""
"doradcą podatkowym."
#: pretix/control/templates/pretixcontrol/event/tax_edit.html:44
#, fuzzy
#| msgid "Customers"
msgid "Custom rules"
msgstr "Reguły niestandardowe"
msgstr "Klienci"
#: pretix/control/templates/pretixcontrol/event/tax_edit.html:46
msgid ""
@@ -26725,8 +26725,6 @@ msgid ""
"The team could not be deleted because the team or one of its API tokens is "
"part of historical audit logs."
msgstr ""
"Zespół nie mógł zostać usunięty, ponieważ zespół lub jeden z jego tokenów "
"API jest częścią historycznych dzienników inspekcji."
#: pretix/control/views/organizer.py:703
msgid ""

View File

@@ -56,7 +56,7 @@ from django.views.generic.base import TemplateResponseMixin
from django_scopes import scopes_disabled
from pretix.base.models import Customer, Membership, Order
from pretix.base.models.items import Question
from pretix.base.models.items import ItemAddOn, ItemVariation, Question
from pretix.base.models.orders import (
InvoiceAddress, OrderPayment, QuestionAnswer,
)
@@ -486,9 +486,33 @@ class AddOnsStep(CartMixin, AsyncAction, TemplateFlowStep):
label = pgettext_lazy('checkoutflow', 'Add-on products')
icon = 'puzzle-piece'
def _is_applicable(self, request):
categories = set(ItemAddOn.objects.filter(
base_item_id__in=get_cart(request).values_list("item_id", flat=True)
).values_list("addon_category_id", flat=True))
if not categories:
return False
has_available_addons = (
self.event.items.filter_available(
channel=request.sales_channel,
allow_addons=True
).filter(
variations__isnull=True,
category__in=categories,
).exists() or ItemVariation.objects.filter_available(
channel=request.sales_channel,
allow_addons=True
).filter(
item__event=self.event,
item__category__in=categories,
)
)
return has_available_addons
def is_applicable(self, request):
if not hasattr(request, '_checkoutflow_addons_applicable'):
request._checkoutflow_addons_applicable = get_cart(request).filter(item__addons__isnull=False).exists()
request._checkoutflow_addons_applicable = self._is_applicable(request)
return request._checkoutflow_addons_applicable
def is_completed(self, request, warn=False):