diff --git a/src/pretix/base/models/vouchers.py b/src/pretix/base/models/vouchers.py index 6886ca59a4..2d0942674c 100644 --- a/src/pretix/base/models/vouchers.py +++ b/src/pretix/base/models/vouchers.py @@ -198,9 +198,13 @@ class Voucher(LoggedModel): @staticmethod def clean_item_properties(data, event, quota, item, variation): if quota: + if quota.event != event: + raise ValidationError(_('You cannot select a quota that belongs to a different event.')) if item: raise ValidationError(_('You cannot select a quota and a specific product at the same time.')) elif item: + if item.event != event: + raise ValidationError(_('You cannot select an item that belongs to a different event.')) if variation and (not item or not item.has_variations): raise ValidationError(_('You cannot select a variation without having selected a product that provides ' 'variations.')) diff --git a/src/pretix/base/services/orders.py b/src/pretix/base/services/orders.py index 45be95e75d..dfa4756573 100644 --- a/src/pretix/base/services/orders.py +++ b/src/pretix/base/services/orders.py @@ -592,7 +592,11 @@ def send_expiry_warnings(sender, **kwargs): 'invoice_name': invoice_name, 'invoice_company': invoice_company, } - email_subject = _('Your order is about to expire: %(code)s') % {'code': o.code} + if eventsettings.payment_term_expire_automatically: + email_subject = _('Your order is about to expire: %(code)s') % {'code': o.code} + else: + email_subject = _('Your order is pending payment: %(code)s') % {'code': o.code} + try: o.send_mail( email_subject, email_template, email_context, diff --git a/src/pretix/control/forms/event.py b/src/pretix/control/forms/event.py index a44a0642fc..a8fb9d6582 100644 --- a/src/pretix/control/forms/event.py +++ b/src/pretix/control/forms/event.py @@ -68,7 +68,7 @@ class EventWizardBasicsForm(I18nModelForm): label=_("Sales tax rate"), help_text=_("Do you need to pay sales tax on your tickets? In this case, please enter the applicable tax rate " "here in percent. If you have a more complicated tax situation, you can add more tax rates and " - "detailled configuration later."), + "detailed configuration later."), required=False ) @@ -265,7 +265,7 @@ class EventSettingsForm(SettingsForm): last_order_modification_date = RelativeDateTimeField( label=_('Last date of modifications'), help_text=_("The last date users can modify details of their orders, such as attendee names or " - "answers to questions. If you use the event series feature and an order contains tickest for " + "answers to questions. If you use the event series feature and an order contains tickets for " "multiple event dates, the earliest date will be used."), required=False, ) diff --git a/src/pretix/control/templates/pretixcontrol/waitinglist/index.html b/src/pretix/control/templates/pretixcontrol/waitinglist/index.html index 02b48a1394..02d9eddf86 100644 --- a/src/pretix/control/templates/pretixcontrol/waitinglist/index.html +++ b/src/pretix/control/templates/pretixcontrol/waitinglist/index.html @@ -37,7 +37,7 @@ You can either send them one-by-one in an order of your choice by clicking the buttons next to a line in this table (if sufficient quota is available) or you can press the big button below this text to send out as many vouchers as currently - possible to the persons who waitet longest. + possible to the persons who waited longest. {% endblocktrans %}

{% endif %} diff --git a/src/pretix/control/views/user.py b/src/pretix/control/views/user.py index 70fa3da6d8..b8a8d12bfc 100644 --- a/src/pretix/control/views/user.py +++ b/src/pretix/control/views/user.py @@ -242,7 +242,7 @@ class User2FADeviceConfirmU2FView(RecentAuthenticationRequiredMixin, TemplateVie if not self.request.user.require_2fa: note = ' ' + str(_('Please note that you still need to enable two-factor authentication for your ' 'account using the buttons below to make a second factor required for logging ' - 'into your accont.')) + 'into your account.')) messages.success(request, str(_('The device has been verified and can now be used.')) + note) return redirect(reverse('control:user.settings.2fa')) except Exception: @@ -291,7 +291,7 @@ class User2FADeviceConfirmTOTPView(RecentAuthenticationRequiredMixin, TemplateVi if not self.request.user.require_2fa: note = ' ' + str(_('Please note that you still need to enable two-factor authentication for your ' 'account using the buttons below to make a second factor required for logging ' - 'into your accont.')) + 'into your account.')) messages.success(request, str(_('The device has been verified and can now be used.')) + note) return redirect(reverse('control:user.settings.2fa')) else: diff --git a/src/pretix/locale/de/LC_MESSAGES/django.po b/src/pretix/locale/de/LC_MESSAGES/django.po index aa534faac7..a734156c00 100644 --- a/src/pretix/locale/de/LC_MESSAGES/django.po +++ b/src/pretix/locale/de/LC_MESSAGES/django.po @@ -3052,7 +3052,7 @@ msgstr "Umsatzsteuersatz" msgid "" "Do you need to pay sales tax on your tickets? In this case, please enter the " "applicable tax rate here in percent. If you have a more complicated tax " -"situation, you can add more tax rates and detailled configuration later." +"situation, you can add more tax rates and detailed configuration later." msgstr "" "Müssen Sie Umsatzsteuern auf Ihre Tickets zahlen? In diesem Fall tragen Sie " "bitte den gültigen Steuersatz hier in Prozent ein. Wenn Sie eine " @@ -3151,7 +3151,7 @@ msgstr "Letztes Änderungsdatum" msgid "" "The last date users can modify details of their orders, such as attendee " "names or answers to questions. If you use the event series feature and an " -"order contains tickest for multiple event dates, the earliest date will be " +"order contains tickets for multiple event dates, the earliest date will be " "used." msgstr "" "Das späteste Datum, zu dem Benutzer die Details ihrer Bestellung (z.B. Namen " @@ -7666,7 +7666,7 @@ msgid "" "automatically. You can either send them one-by-one in an order of your " "choice by clicking the buttons next to a line in this table (if sufficient " "quota is available) or you can press the big button below this text to send " -"out as many vouchers as currently possible to the persons who waitet longest." +"out as many vouchers as currently possible to the persons who waited longest." msgstr "" "Sie haben eingestellt, dass Gutscheine nicht an die " "Personen auf dieser Liste verschickt werden. Sie können die Gutscheine " @@ -8450,7 +8450,7 @@ msgstr "Ein Gerät zur Zwei-Faktor-Authentifizierung wurde hinzugefügt." msgid "" "Please note that you still need to enable two-factor authentication for your " "account using the buttons below to make a second factor required for logging " -"into your accont." +"into your account." msgstr "" "Bitte beachten Sie, dass sie die Zwei-Faktor-Authentifizierung noch mit dem " "unten verfügbaren Knopf für Ihr Konto aktiviert müssen, damit der zweite " @@ -9108,7 +9108,7 @@ msgstr "PayPal meldete ein Ereignis: {}" msgid "" "The PayPal transaction %(payment)s has succeeded, but the order %(order)s is " "expired and the product was sold out in the meantime. Therefore, the payment " -"could not be acceped. Please contact the user and refund the money via " +"could not be accepted. Please contact the user and refund the money via " "PayPal's interface." msgstr "" "Die PayPal-Transaktion %(payment)s war erfolgreich, aber die Bestellung " @@ -9139,7 +9139,7 @@ msgstr "Diese Aktion kann nicht rückgängig gemacht werden." #: pretix/plugins/paypal/templates/pretixplugins/paypal/checkout_payment_confirm.html:3 msgid "" -"The total amount listed above will be withdrawn from your PayPal acocunt " +"The total amount listed above will be withdrawn from your PayPal account " "after the confirmation of your purchase." msgstr "" "Der obige Gesamtbetrag wird nach der Bestätigung Ihrer Bestellung von Ihrem " @@ -9825,7 +9825,7 @@ msgstr "Stripe meldete ein Ereignis: {}" msgid "" "The Stripe transaction %(charge)s has succeeded, but " "the order %(order)s is expired and the product was sold out in the meantime. " -"Therefore, the payment could not be acceped. Please contact the user and " +"Therefore, the payment could not be accepted. Please contact the user and " "refund the money via Stripe's interface." msgstr "" "Die Stripe-Zahlung %(charge)s war erfolgreich, aber " @@ -10107,7 +10107,7 @@ msgstr "" #: pretix/plugins/ticketoutputpdf/templates/pretixplugins/ticketoutputpdf/index.html:108 msgid "" -"The editor is tested with recent versions of Google Chome, Mozilla Firefox " +"The editor is tested with recent versions of Google Chrome, Mozilla Firefox " "and Opera. Other browsers, especially Internet Explorer or Microsoft Edge, " "might have problems displaying your background PDF or loading the correct " "fonts." diff --git a/src/pretix/locale/de/LC_MESSAGES/djangojs.po b/src/pretix/locale/de/LC_MESSAGES/djangojs.po index c13d5bbfd2..62cd62c092 100644 --- a/src/pretix/locale/de/LC_MESSAGES/djangojs.po +++ b/src/pretix/locale/de/LC_MESSAGES/djangojs.po @@ -133,7 +133,7 @@ msgstr "" #: pretix/static/pretixbase/js/asynctask.js:65 msgid "" -"We currenctly cannot reach the server, but we keep trying. Last error code: " +"We currently cannot reach the server, but we keep trying. Last error code: " "{code}" msgstr "" "Wir können den Server aktuell nicht erreichen, versuchen es aber weiter. " @@ -146,7 +146,7 @@ msgstr "Diese Anfrage hat zu lange gedauert. Bitte erneut versuchen." #: pretix/static/pretixbase/js/asynctask.js:119 msgid "" -"We currenctly cannot reach the server. Please try again. Error code: {code}" +"We currently cannot reach the server. Please try again. Error code: {code}" msgstr "" "Wir können den Server aktuell nicht erreichen. Bitte versuchen Sie es noch " "einmal. Fehlercode: {code}" diff --git a/src/pretix/plugins/paypal/templates/pretixplugins/paypal/action_overpaid.html b/src/pretix/plugins/paypal/templates/pretixplugins/paypal/action_overpaid.html index 12dec90b74..5e97c0cf22 100644 --- a/src/pretix/plugins/paypal/templates/pretixplugins/paypal/action_overpaid.html +++ b/src/pretix/plugins/paypal/templates/pretixplugins/paypal/action_overpaid.html @@ -4,7 +4,7 @@ {% url "control:event.order" organizer=event.organizer.slug event=event.slug code=data.order as ourl %} {% blocktrans trimmed with payment=data.payment order=""|add:data.order|add:""|safe %} The PayPal transaction {{ payment }} has succeeded, but the order {{ order }} is expired and the product - was sold out in the meantime. Therefore, the payment could not be acceped. Please contact the user and refund + was sold out in the meantime. Therefore, the payment could not be accepted. Please contact the user and refund the money via PayPal's interface. {% endblocktrans %}

diff --git a/src/pretix/plugins/paypal/templates/pretixplugins/paypal/checkout_payment_confirm.html b/src/pretix/plugins/paypal/templates/pretixplugins/paypal/checkout_payment_confirm.html index 2420f5561f..f10976374d 100644 --- a/src/pretix/plugins/paypal/templates/pretixplugins/paypal/checkout_payment_confirm.html +++ b/src/pretix/plugins/paypal/templates/pretixplugins/paypal/checkout_payment_confirm.html @@ -1,6 +1,6 @@ {% load i18n %}

{% blocktrans trimmed %} - The total amount listed above will be withdrawn from your PayPal acocunt after the + The total amount listed above will be withdrawn from your PayPal account after the confirmation of your purchase. {% endblocktrans %}

diff --git a/src/pretix/plugins/ticketoutputpdf/templates/pretixplugins/ticketoutputpdf/index.html b/src/pretix/plugins/ticketoutputpdf/templates/pretixplugins/ticketoutputpdf/index.html index 64aff7ec1e..435aea0632 100644 --- a/src/pretix/plugins/ticketoutputpdf/templates/pretixplugins/ticketoutputpdf/index.html +++ b/src/pretix/plugins/ticketoutputpdf/templates/pretixplugins/ticketoutputpdf/index.html @@ -106,7 +106,7 @@

{% blocktrans trimmed %} - The editor is tested with recent versions of Google Chome, Mozilla Firefox + The editor is tested with recent versions of Google Chrome, Mozilla Firefox and Opera. Other browsers, especially Internet Explorer or Microsoft Edge, might have problems displaying your background PDF or loading the correct fonts. {% endblocktrans %} diff --git a/src/pretix/static/pretixbase/js/asynctask.js b/src/pretix/static/pretixbase/js/asynctask.js index c34d056c00..ccdd0e56e2 100644 --- a/src/pretix/static/pretixbase/js/asynctask.js +++ b/src/pretix/static/pretixbase/js/asynctask.js @@ -62,7 +62,7 @@ function async_task_check_error(jqXHR, textStatus, errorThrown) { alert(gettext('An error of type {code} occured.').replace(/\{code\}/, jqXHR.status)); } else { // 500 can be an application error or overload in some cases :( - $("#loadingmodal p").text(gettext('We currenctly cannot reach the server, but we keep trying.' + + $("#loadingmodal p").text(gettext('We currently cannot reach the server, but we keep trying.' + ' Last error code: {code}').replace(/\{code\}/, jqXHR.status)); async_task_timeout = window.setTimeout(async_task_check, 5000); } @@ -116,7 +116,7 @@ function async_task_error(jqXHR, textStatus, errorThrown) { alert(gettext('An error of type {code} occured.').replace(/\{code\}/, jqXHR.status)); } else { waitingDialog.hide(); - alert(gettext('We currenctly cannot reach the server. Please try again. ' + + alert(gettext('We currently cannot reach the server. Please try again. ' + 'Error code: {code}').replace(/\{code\}/, jqXHR.status)); } } diff --git a/src/tests/api/test_vouchers.py b/src/tests/api/test_vouchers.py index 470cb57bee..be657a40a1 100644 --- a/src/tests/api/test_vouchers.py +++ b/src/tests/api/test_vouchers.py @@ -4,8 +4,9 @@ from decimal import Decimal import pytest from django.utils import timezone from django.utils.timezone import now +from pytz import UTC -from pretix.base.models import Voucher +from pretix.base.models import Event, Voucher @pytest.fixture @@ -541,6 +542,28 @@ def change_voucher(token_client, organizer, event, voucher, data, expected_failu voucher.refresh_from_db() +@pytest.mark.django_db +def test_change_to_item_of_other_event(token_client, organizer, event, item): + e2 = Event.objects.create( + organizer=organizer, + name='Dummy2', + slug='dummy2', + date_from=datetime.datetime(2017, 12, 27, 10, 0, 0, tzinfo=UTC), + plugins='pretix.plugins.banktransfer,pretix.plugins.ticketoutputpdf' + ) + ticket2 = e2.items.create(name='Late-bird ticket', default_price=23) + v = event.vouchers.create(item=item) + change_voucher( + token_client, organizer, event, v, + data={ + 'item': ticket2.pk + }, + expected_failure=True + ) + v.refresh_from_db() + assert v.item == item + + @pytest.mark.django_db def test_change_non_blocking_voucher(token_client, organizer, event, item, quota): v = event.vouchers.create(item=item)