Upgrade to Django 3.2 (#2056)

This commit is contained in:
Raphael Michel
2021-05-07 12:00:30 +02:00
committed by GitHub
parent 0a7a3537eb
commit 403b8191e4
120 changed files with 1994 additions and 1555 deletions

View File

@@ -19,15 +19,3 @@
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
# <https://www.gnu.org/licenses/>.
#
from django.apps import AppConfig
class PretixPresaleConfig(AppConfig):
name = 'pretix.presale'
label = 'pretixpresale'
def ready(self):
from . import style # noqa
default_app_config = 'pretix.presale.PretixPresaleConfig'

View File

@@ -0,0 +1,30 @@
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free Software Foundation in version 3 of the License.
#
# ADDITIONAL TERMS APPLY: Pursuant to Section 7 of the GNU Affero General Public License, additional terms are
# applicable granting you additional permissions and placing additional restrictions on your usage of this software.
# Please refer to the pretix LICENSE file to obtain the full terms applicable to this work. If you did not receive
# this file, see <https://pretix.eu/about/en/license>.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along with this program. If not, see
# <https://www.gnu.org/licenses/>.
#
from django.apps import AppConfig
class PretixPresaleConfig(AppConfig):
name = 'pretix.presale'
label = 'pretixpresale'
def ready(self):
from . import style # noqa

View File

@@ -36,10 +36,10 @@ from django.dispatch import Signal
from pretix.base.signals import EventPluginSignal
global_html_head = Signal(
providing_args=["request"]
)
global_html_head = Signal()
"""
Arguments: ``request``
This signal allows you to put code inside the HTML ``<head>`` tag
of every page in the frontend. You will get the request as the keyword argument
``request`` and are expected to return plain HTML.
@@ -47,10 +47,10 @@ of every page in the frontend. You will get the request as the keyword argument
This signal is called regardless of whether your plugin is active for all pages of the system.
"""
global_html_page_header = Signal(
providing_args=["request"]
)
global_html_page_header = Signal()
"""
Arguments: ``request``
This signal allows you to put code right in the beginning of the HTML ``<body>`` tag
of every page in the frontend. You will get the request as the keyword argument
``request`` and are expected to return plain HTML.
@@ -58,10 +58,10 @@ of every page in the frontend. You will get the request as the keyword argument
This signal is called regardless of whether your plugin is active for all pages of the system.
"""
global_html_footer = Signal(
providing_args=["request"]
)
global_html_footer = Signal()
"""
Arguments: ``request``
This signal allows you to put code before the end of the HTML ``<body>`` tag
of every page in the frontend. You will get the request as the keyword argument
``request`` and are expected to return plain HTML.
@@ -69,10 +69,10 @@ of every page in the frontend. You will get the request as the keyword argument
This signal is called regardless of whether your plugin is active for all pages of the system.
"""
html_head = EventPluginSignal(
providing_args=["request"]
)
html_head = EventPluginSignal()
"""
Arguments: ``request``
This signal allows you to put code inside the HTML ``<head>`` tag
of every page in the frontend. You will get the request as the keyword argument
``request`` and are expected to return plain HTML.
@@ -80,10 +80,10 @@ of every page in the frontend. You will get the request as the keyword argument
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
html_page_header = EventPluginSignal(
providing_args=["request"]
)
html_page_header = EventPluginSignal()
"""
Arguments: ``request``
This signal allows you to put code right in the beginning of the HTML ``<body>`` tag
of every page in the frontend. You will get the request as the keyword argument
``request`` and are expected to return plain HTML.
@@ -91,10 +91,10 @@ of every page in the frontend. You will get the request as the keyword argument
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
html_footer = EventPluginSignal(
providing_args=["request"]
)
html_footer = EventPluginSignal()
"""
Arguments: ``request``
This signal allows you to put code before the end of the HTML ``<body>`` tag
of every page in the frontend. You will get the request as the keyword argument
``request`` and are expected to return plain HTML.
@@ -102,10 +102,10 @@ of every page in the frontend. You will get the request as the keyword argument
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
sass_preamble = EventPluginSignal(
providing_args=["filename"]
)
sass_preamble = EventPluginSignal()
"""
Arguments: ``filename``
This signal allows you to put SASS code at the beginning of the event-specific
stylesheet. Keep in mind that this will only be called/rebuilt when the user changes
display settings or pretix gets updated. You will get the filename that is being
@@ -116,10 +116,10 @@ code.
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
sass_postamble = EventPluginSignal(
providing_args=["filename"]
)
sass_postamble = EventPluginSignal()
"""
Arguments: ``filename``
This signal allows you to put SASS code at the end of the event-specific
stylesheet. Keep in mind that this will only be called/rebuilt when the user changes
display settings or pretix gets updated. You will get the filename that is being
@@ -129,20 +129,20 @@ all of pretix' SASS code.
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
footer_link = EventPluginSignal(
providing_args=["request"]
)
footer_link = EventPluginSignal()
"""
Arguments: ``request``
The signal ``pretix.presale.signals.footer_link`` allows you to add links to the footer of an event page. You
are expected to return a dictionary containing the keys ``label`` and ``url``.
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
global_footer_link = Signal(
providing_args=["request"]
)
global_footer_link = Signal()
"""
Arguments: ``request``
The signal ``pretix.presale.signals.global_footer_link`` allows you to add links to the footer of any page. You
are expected to return a dictionary containing the keys ``label`` and ``url``.
"""
@@ -165,29 +165,29 @@ a subclass of ``pretix.presale.checkoutflow.BaseCheckoutFlowStep``.
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
voucher_redeem_info = EventPluginSignal(
providing_args=["voucher"]
)
voucher_redeem_info = EventPluginSignal()
"""
Arguments: ``voucher``
This signal is sent out to display additional information on the "redeem a voucher" page
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
order_meta_from_request = EventPluginSignal(
providing_args=["request"]
)
order_meta_from_request = EventPluginSignal()
"""
Arguments: ``request``
This signal is sent before an order is created through the pretixpresale frontend. It allows you
to return a dictionary that will be merged in the meta_info attribute of the order.
You will receive the request triggering the order creation as the ``request`` keyword argument.
As with all event-plugin signals, the ``sender`` keyword argument will contain the event.
"""
checkout_confirm_page_content = EventPluginSignal(
providing_args=['request']
)
checkout_confirm_page_content = EventPluginSignal()
"""
Arguments: 'request'
This signals allows you to add HTML content to the confirmation page that is presented at the
end of the checkout process, just before the order is being created.
@@ -195,10 +195,10 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve
argument will contain the request object.
"""
fee_calculation_for_cart = EventPluginSignal(
providing_args=['request', 'invoice_address', 'total', 'positions']
)
fee_calculation_for_cart = EventPluginSignal()
"""
Arguments: 'request', 'invoice_address', 'total', 'positions'
This signals allows you to add fees to a cart. You are expected to return a list of ``OrderFee``
objects that are not yet saved to the database (because there is no order yet).
@@ -209,9 +209,7 @@ You should not rely on this ``total`` value for fee calculations as other fees m
The ``positions`` argument will contain a list or queryset of ``CartPosition`` objects.
"""
contact_form_fields = EventPluginSignal(
providing_args=[]
)
contact_form_fields = EventPluginSignal()
"""
This signals allows you to add form fields to the contact form that is presented during checkout
and by default only asks for the email address. You are supposed to return a dictionary of
@@ -222,10 +220,10 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve
argument will contain the request object.
"""
contact_form_fields_overrides = EventPluginSignal(
providing_args=["request", "order"]
)
contact_form_fields_overrides = EventPluginSignal()
"""
Arguments: ``request``, ``order``
This signal allows you to override fields of the contact form that is presented during checkout
and by default only asks for the email address. It is also being used for the invoice address
form. You are supposed to return a dictionary of dictionaries with globally unique keys. The
@@ -237,10 +235,10 @@ argument will contain the request object. The ``order`` argument is ``None`` dur
process and contains an order if the customer is trying to change an existing order.
"""
question_form_fields = EventPluginSignal(
providing_args=["position"]
)
question_form_fields = EventPluginSignal()
"""
Arguments: ``position``
This signals allows you to add form fields to the questions form that is presented during checkout
and by default asks for the questions configured in the backend. You are supposed to return a dictionary
of form fields with globally unique keys. The validated form results will be saved into the
@@ -253,10 +251,10 @@ later.
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
question_form_fields_overrides = EventPluginSignal(
providing_args=["position", "request"]
)
question_form_fields_overrides = EventPluginSignal()
"""
Arguments: ``position``, ``request``
This signal allows you to override fields of the questions form that is presented during checkout
and by default only asks for the questions configured in the backend. You are supposed to return a
dictionary of dictionaries with globally unique keys. The value-dictionary should contain one or
@@ -270,46 +268,46 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve
argument will contain the request object.
"""
order_info = EventPluginSignal(
providing_args=["order", "request"]
)
order_info = EventPluginSignal()
"""
Arguments: ``order``, ``request``
This signal is sent out to display additional information on the order detail page
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
position_info = EventPluginSignal(
providing_args=["order", "position", "request"]
)
position_info = EventPluginSignal()
"""
Arguments: ``order``, ``position``, ``request``
This signal is sent out to display additional information on the position detail page
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
order_info_top = EventPluginSignal(
providing_args=["order", "request"]
)
order_info_top = EventPluginSignal()
"""
Arguments: ``order``, ``request``
This signal is sent out to display additional information on top of the order detail page
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
position_info_top = EventPluginSignal(
providing_args=["order", "position", "request"]
)
position_info_top = EventPluginSignal()
"""
Arguments: ``order``, ``position``, ``request``
This signal is sent out to display additional information on top of the position detail page
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
process_request = EventPluginSignal(
providing_args=["request"]
)
process_request = EventPluginSignal()
"""
Arguments: ``request``
This signal is sent out whenever a request is made to a event presale page. Most of the
time, this will be called from the middleware layer (except on plugin-provided pages
this will be called by the @event_view decorator). Similarly to Django's process_request
@@ -322,10 +320,10 @@ easy to cause serious performance problems.
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
process_response = EventPluginSignal(
providing_args=["request", "response"]
)
process_response = EventPluginSignal()
"""
Arguments: ``request``, ``response``
This signal is sent out whenever a response is sent from a event presale page. Most of
the time, this will be called from the middleware layer (except on plugin-provided pages
this will be called by the @event_view decorator). Similarly to Django's process_response
@@ -339,10 +337,10 @@ easy to cause serious performance problems.
As with all plugin signals, the ``sender`` keyword argument will contain the event.
"""
front_page_top = EventPluginSignal(
providing_args=["request", "subevent"]
)
front_page_top = EventPluginSignal()
"""
Arguments: ``request``, ``subevent``
This signal is sent out to display additional information on the frontpage above the list
of products and but below a custom frontpage text.
@@ -350,10 +348,10 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve
receivers are expected to return HTML.
"""
render_seating_plan = EventPluginSignal(
providing_args=["request", "subevent", "voucher"]
)
render_seating_plan = EventPluginSignal()
"""
Arguments: ``request``, ``subevent``, ``voucher``
This signal is sent out to render a seating plan, if one is configured for the specific event.
You will be passed the ``request`` as a keyword argument. If applicable, a ``subevent`` or
``voucher`` argument might be given.
@@ -362,10 +360,10 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve
receivers are expected to return HTML.
"""
front_page_bottom = EventPluginSignal(
providing_args=["request", "subevent"]
)
front_page_bottom = EventPluginSignal()
"""
Arguments: ``request``, ``subevent``
This signal is sent out to display additional information on the frontpage below the list
of products.
@@ -373,10 +371,10 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve
receivers are expected to return HTML.
"""
front_page_bottom_widget = EventPluginSignal(
providing_args=["request", "subevent"]
)
front_page_bottom_widget = EventPluginSignal()
"""
Arguments: ``request``, ``subevent``
This signal is sent out to display additional information on the frontpage below the list
of products if the front page is shown in the widget.
@@ -384,10 +382,10 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve
receivers are expected to return HTML.
"""
checkout_all_optional = EventPluginSignal(
providing_args=['request']
)
checkout_all_optional = EventPluginSignal()
"""
Arguments: 'request'
If any receiver of this signal returns ``True``, all input fields during checkout (contact data,
invoice address, confirmations) will be optional, except for questions. Use with care!
@@ -395,10 +393,10 @@ As with all plugin signals, the ``sender`` keyword argument will contain the eve
argument will contain the request object.
"""
item_description = EventPluginSignal(
providing_args=["item", "variation"]
)
item_description = EventPluginSignal()
"""
Arguments: ``item``, ``variation``
This signal is sent out when the description of an item or variation is rendered and allows you to append
additional text to the description. You are passed the ``item`` and ``variation`` and expected to return
HTML.

View File

@@ -32,7 +32,7 @@
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under the License.
from django.conf.urls import include, url
from django.conf.urls import include, re_path
from django.views.decorators.csrf import csrf_exempt
import pretix.presale.views.cart
@@ -52,137 +52,137 @@ import pretix.presale.views.widget
# configuration is done by the pretix.multidomain package.
frame_wrapped_urls = [
url(r'^cart/remove$', pretix.presale.views.cart.CartRemove.as_view(), name='event.cart.remove'),
url(r'^cart/voucher$', pretix.presale.views.cart.CartApplyVoucher.as_view(), name='event.cart.voucher'),
url(r'^cart/clear$', pretix.presale.views.cart.CartClear.as_view(), name='event.cart.clear'),
url(r'^cart/answer/(?P<answer>[^/]+)/$',
pretix.presale.views.cart.AnswerDownload.as_view(),
name='event.cart.download.answer'),
url(r'^checkout/start$', pretix.presale.views.checkout.CheckoutView.as_view(), name='event.checkout.start'),
url(r'^checkout/(?P<step>[^/]+)/$', pretix.presale.views.checkout.CheckoutView.as_view(),
name='event.checkout'),
url(r'^redeem/?$', pretix.presale.views.cart.RedeemView.as_view(),
name='event.redeem'),
url(r'^seatingframe/$', pretix.presale.views.event.SeatingPlanView.as_view(),
name='event.seatingplan'),
url(r'^(?P<subevent>[0-9]+)/seatingframe/$', pretix.presale.views.event.SeatingPlanView.as_view(),
name='event.seatingplan'),
url(r'^(?P<subevent>[0-9]+)/$', pretix.presale.views.event.EventIndex.as_view(), name='event.index'),
url(r'^waitinglist', pretix.presale.views.waiting.WaitingView.as_view(), name='event.waitinglist'),
url(r'^$', pretix.presale.views.event.EventIndex.as_view(), name='event.index'),
re_path(r'^cart/remove$', pretix.presale.views.cart.CartRemove.as_view(), name='event.cart.remove'),
re_path(r'^cart/voucher$', pretix.presale.views.cart.CartApplyVoucher.as_view(), name='event.cart.voucher'),
re_path(r'^cart/clear$', pretix.presale.views.cart.CartClear.as_view(), name='event.cart.clear'),
re_path(r'^cart/answer/(?P<answer>[^/]+)/$',
pretix.presale.views.cart.AnswerDownload.as_view(),
name='event.cart.download.answer'),
re_path(r'^checkout/start$', pretix.presale.views.checkout.CheckoutView.as_view(), name='event.checkout.start'),
re_path(r'^checkout/(?P<step>[^/]+)/$', pretix.presale.views.checkout.CheckoutView.as_view(),
name='event.checkout'),
re_path(r'^redeem/?$', pretix.presale.views.cart.RedeemView.as_view(),
name='event.redeem'),
re_path(r'^seatingframe/$', pretix.presale.views.event.SeatingPlanView.as_view(),
name='event.seatingplan'),
re_path(r'^(?P<subevent>[0-9]+)/seatingframe/$', pretix.presale.views.event.SeatingPlanView.as_view(),
name='event.seatingplan'),
re_path(r'^(?P<subevent>[0-9]+)/$', pretix.presale.views.event.EventIndex.as_view(), name='event.index'),
re_path(r'^waitinglist', pretix.presale.views.waiting.WaitingView.as_view(), name='event.waitinglist'),
re_path(r'^$', pretix.presale.views.event.EventIndex.as_view(), name='event.index'),
]
event_patterns = [
# Cart/checkout patterns are a bit more complicated, as they should have simple URLs like cart/clear in normal
# cases, but need to have versions with unguessable URLs like w/8l4Y83XNonjLxoBb/cart/clear to be used in widget
# mode. This is required to prevent all clickjacking and CSRF attacks that would otherwise be possible.
# First, we define the normal version. The docstring of get_or_create_cart_id() has more information on this.
url(r'', include(frame_wrapped_urls)),
re_path(r'', include(frame_wrapped_urls)),
# Second, the widget version
url(r'w/(?P<cart_namespace>[a-zA-Z0-9]{16})/', include(frame_wrapped_urls)),
re_path(r'w/(?P<cart_namespace>[a-zA-Z0-9]{16})/', include(frame_wrapped_urls)),
# Third, a fake version that is defined like the first (and never gets called), but makes reversing URLs easier
url(r'(?P<cart_namespace>[_]{0})', include(frame_wrapped_urls)),
re_path(r'(?P<cart_namespace>[_]{0})', include(frame_wrapped_urls)),
# CartAdd goes extra since it also gets a csrf_exempt decorator in one of the cases
url(r'^cart/add$', pretix.presale.views.cart.CartAdd.as_view(), name='event.cart.add'),
url(r'^(?P<cart_namespace>[_]{0})cart/add$', pretix.presale.views.cart.CartAdd.as_view(), name='event.cart.add'),
url(r'w/(?P<cart_namespace>[a-zA-Z0-9]{16})/cart/add',
csrf_exempt(pretix.presale.views.cart.CartAdd.as_view()),
name='event.cart.add'),
re_path(r'^cart/add$', pretix.presale.views.cart.CartAdd.as_view(), name='event.cart.add'),
re_path(r'^(?P<cart_namespace>[_]{0})cart/add$', pretix.presale.views.cart.CartAdd.as_view(), name='event.cart.add'),
re_path(r'w/(?P<cart_namespace>[a-zA-Z0-9]{16})/cart/add',
csrf_exempt(pretix.presale.views.cart.CartAdd.as_view()),
name='event.cart.add'),
url(r'unlock/(?P<hash>[a-z0-9]{64})/$', pretix.presale.views.user.UnlockHashView.as_view(),
name='event.payment.unlock'),
url(r'resend/$', pretix.presale.views.user.ResendLinkView.as_view(), name='event.resend_link'),
re_path(r'unlock/(?P<hash>[a-z0-9]{64})/$', pretix.presale.views.user.UnlockHashView.as_view(),
name='event.payment.unlock'),
re_path(r'resend/$', pretix.presale.views.user.ResendLinkView.as_view(), name='event.resend_link'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/open/(?P<hash>[a-z0-9]+)/$', pretix.presale.views.order.OrderOpen.as_view(),
name='event.order.open'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/$', pretix.presale.views.order.OrderDetails.as_view(),
name='event.order'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/invoice$',
pretix.presale.views.order.OrderInvoiceCreate.as_view(),
name='event.order.geninvoice'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/change$',
pretix.presale.views.order.OrderChange.as_view(),
name='event.order.change'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/cancel$',
pretix.presale.views.order.OrderCancel.as_view(),
name='event.order.cancel'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/cancel/do$',
pretix.presale.views.order.OrderCancelDo.as_view(),
name='event.order.cancel.do'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/modify$',
pretix.presale.views.order.OrderModify.as_view(),
name='event.order.modify'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/pay/(?P<payment>[0-9]+)/$',
pretix.presale.views.order.OrderPaymentStart.as_view(),
name='event.order.pay'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/pay/(?P<payment>[0-9]+)/confirm$',
pretix.presale.views.order.OrderPaymentConfirm.as_view(),
name='event.order.pay.confirm'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/pay/(?P<payment>[0-9]+)/complete$',
pretix.presale.views.order.OrderPaymentComplete.as_view(),
name='event.order.pay.complete'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/pay/change',
pretix.presale.views.order.OrderPayChangeMethod.as_view(),
name='event.order.pay.change'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/answer/(?P<answer>[^/]+)/$',
pretix.presale.views.order.AnswerDownload.as_view(),
name='event.order.download.answer'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/download/(?P<output>[^/]+)$',
pretix.presale.views.order.OrderDownload.as_view(),
name='event.order.download.combined'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/download/(?P<position>[0-9]+)/(?P<output>[^/]+)$',
pretix.presale.views.order.OrderDownload.as_view(),
name='event.order.download'),
url(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/invoice/(?P<invoice>[0-9]+)$',
pretix.presale.views.order.InvoiceDownload.as_view(),
name='event.invoice.download'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/open/(?P<hash>[a-z0-9]+)/$', pretix.presale.views.order.OrderOpen.as_view(),
name='event.order.open'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/$', pretix.presale.views.order.OrderDetails.as_view(),
name='event.order'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/invoice$',
pretix.presale.views.order.OrderInvoiceCreate.as_view(),
name='event.order.geninvoice'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/change$',
pretix.presale.views.order.OrderChange.as_view(),
name='event.order.change'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/cancel$',
pretix.presale.views.order.OrderCancel.as_view(),
name='event.order.cancel'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/cancel/do$',
pretix.presale.views.order.OrderCancelDo.as_view(),
name='event.order.cancel.do'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/modify$',
pretix.presale.views.order.OrderModify.as_view(),
name='event.order.modify'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/pay/(?P<payment>[0-9]+)/$',
pretix.presale.views.order.OrderPaymentStart.as_view(),
name='event.order.pay'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/pay/(?P<payment>[0-9]+)/confirm$',
pretix.presale.views.order.OrderPaymentConfirm.as_view(),
name='event.order.pay.confirm'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/pay/(?P<payment>[0-9]+)/complete$',
pretix.presale.views.order.OrderPaymentComplete.as_view(),
name='event.order.pay.complete'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/pay/change',
pretix.presale.views.order.OrderPayChangeMethod.as_view(),
name='event.order.pay.change'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/answer/(?P<answer>[^/]+)/$',
pretix.presale.views.order.AnswerDownload.as_view(),
name='event.order.download.answer'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/download/(?P<output>[^/]+)$',
pretix.presale.views.order.OrderDownload.as_view(),
name='event.order.download.combined'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/download/(?P<position>[0-9]+)/(?P<output>[^/]+)$',
pretix.presale.views.order.OrderDownload.as_view(),
name='event.order.download'),
re_path(r'^order/(?P<order>[^/]+)/(?P<secret>[A-Za-z0-9]+)/invoice/(?P<invoice>[0-9]+)$',
pretix.presale.views.order.InvoiceDownload.as_view(),
name='event.invoice.download'),
url(r'^ticket/(?P<order>[^/]+)/(?P<position>\d+)/(?P<secret>[A-Za-z0-9]+)/$',
pretix.presale.views.order.OrderPositionDetails.as_view(),
name='event.order.position'),
url(r'^ticket/(?P<order>[^/]+)/(?P<position>\d+)/(?P<secret>[A-Za-z0-9]+)/download/(?P<pid>[0-9]+)/(?P<output>[^/]+)$',
pretix.presale.views.order.OrderPositionDownload.as_view(),
name='event.order.position.download'),
re_path(r'^ticket/(?P<order>[^/]+)/(?P<position>\d+)/(?P<secret>[A-Za-z0-9]+)/$',
pretix.presale.views.order.OrderPositionDetails.as_view(),
name='event.order.position'),
re_path(r'^ticket/(?P<order>[^/]+)/(?P<position>\d+)/(?P<secret>[A-Za-z0-9]+)/download/(?P<pid>[0-9]+)/(?P<output>[^/]+)$',
pretix.presale.views.order.OrderPositionDownload.as_view(),
name='event.order.position.download'),
url(r'^ical/?$',
pretix.presale.views.event.EventIcalDownload.as_view(),
name='event.ical.download'),
url(r'^ical/(?P<subevent>[0-9]+)/$',
pretix.presale.views.event.EventIcalDownload.as_view(),
name='event.ical.download'),
url(r'^auth/$', pretix.presale.views.event.EventAuth.as_view(), name='event.auth'),
re_path(r'^ical/?$',
pretix.presale.views.event.EventIcalDownload.as_view(),
name='event.ical.download'),
re_path(r'^ical/(?P<subevent>[0-9]+)/$',
pretix.presale.views.event.EventIcalDownload.as_view(),
name='event.ical.download'),
re_path(r'^auth/$', pretix.presale.views.event.EventAuth.as_view(), name='event.auth'),
url(r'^widget/product_list$', pretix.presale.views.widget.WidgetAPIProductList.as_view(),
name='event.widget.productlist'),
url(r'^widget/v1.css$', pretix.presale.views.widget.widget_css, name='event.widget.css'),
url(r'^(?P<subevent>\d+)/widget/product_list$', pretix.presale.views.widget.WidgetAPIProductList.as_view(),
name='event.widget.productlist'),
re_path(r'^widget/product_list$', pretix.presale.views.widget.WidgetAPIProductList.as_view(),
name='event.widget.productlist'),
re_path(r'^widget/v1.css$', pretix.presale.views.widget.widget_css, name='event.widget.css'),
re_path(r'^(?P<subevent>\d+)/widget/product_list$', pretix.presale.views.widget.WidgetAPIProductList.as_view(),
name='event.widget.productlist'),
]
organizer_patterns = [
url(r'^$', pretix.presale.views.organizer.OrganizerIndex.as_view(), name='organizer.index'),
url(r'^events/ical/$',
pretix.presale.views.organizer.OrganizerIcalDownload.as_view(),
name='organizer.ical'),
url(r'^widget/product_list$', pretix.presale.views.widget.WidgetAPIProductList.as_view(),
name='organizer.widget.productlist'),
url(r'^widget/v1.css$', pretix.presale.views.widget.widget_css, name='organizer.widget.css'),
url(r'^account/login$', pretix.presale.views.customer.LoginView.as_view(), name='organizer.customer.login'),
url(r'^account/logout$', pretix.presale.views.customer.LogoutView.as_view(), name='organizer.customer.logout'),
url(r'^account/register$', pretix.presale.views.customer.RegistrationView.as_view(), name='organizer.customer.register'),
url(r'^account/pwreset$', pretix.presale.views.customer.ResetPasswordView.as_view(), name='organizer.customer.resetpw'),
url(r'^account/pwrecover$', pretix.presale.views.customer.SetPasswordView.as_view(), name='organizer.customer.recoverpw'),
url(r'^account/activate$', pretix.presale.views.customer.SetPasswordView.as_view(), name='organizer.customer.activate'),
url(r'^account/password$', pretix.presale.views.customer.ChangePasswordView.as_view(), name='organizer.customer.password'),
url(r'^account/change$', pretix.presale.views.customer.ChangeInformationView.as_view(), name='organizer.customer.change'),
url(r'^account/confirmchange$', pretix.presale.views.customer.ConfirmChangeView.as_view(), name='organizer.customer.change.confirm'),
url(r'^account/membership/(?P<id>\d+)/$', pretix.presale.views.customer.MembershipUsageView.as_view(), name='organizer.customer.membership'),
url(r'^account/$', pretix.presale.views.customer.ProfileView.as_view(), name='organizer.customer.profile'),
re_path(r'^$', pretix.presale.views.organizer.OrganizerIndex.as_view(), name='organizer.index'),
re_path(r'^events/ical/$',
pretix.presale.views.organizer.OrganizerIcalDownload.as_view(),
name='organizer.ical'),
re_path(r'^widget/product_list$', pretix.presale.views.widget.WidgetAPIProductList.as_view(),
name='organizer.widget.productlist'),
re_path(r'^widget/v1.css$', pretix.presale.views.widget.widget_css, name='organizer.widget.css'),
re_path(r'^account/login$', pretix.presale.views.customer.LoginView.as_view(), name='organizer.customer.login'),
re_path(r'^account/logout$', pretix.presale.views.customer.LogoutView.as_view(), name='organizer.customer.logout'),
re_path(r'^account/register$', pretix.presale.views.customer.RegistrationView.as_view(), name='organizer.customer.register'),
re_path(r'^account/pwreset$', pretix.presale.views.customer.ResetPasswordView.as_view(), name='organizer.customer.resetpw'),
re_path(r'^account/pwrecover$', pretix.presale.views.customer.SetPasswordView.as_view(), name='organizer.customer.recoverpw'),
re_path(r'^account/activate$', pretix.presale.views.customer.SetPasswordView.as_view(), name='organizer.customer.activate'),
re_path(r'^account/password$', pretix.presale.views.customer.ChangePasswordView.as_view(), name='organizer.customer.password'),
re_path(r'^account/change$', pretix.presale.views.customer.ChangeInformationView.as_view(), name='organizer.customer.change'),
re_path(r'^account/confirmchange$', pretix.presale.views.customer.ConfirmChangeView.as_view(), name='organizer.customer.change.confirm'),
re_path(r'^account/membership/(?P<id>\d+)/$', pretix.presale.views.customer.MembershipUsageView.as_view(), name='organizer.customer.membership'),
re_path(r'^account/$', pretix.presale.views.customer.ProfileView.as_view(), name='organizer.customer.profile'),
]
locale_patterns = [
url(r'^locale/set$', pretix.presale.views.locale.LocaleSet.as_view(), name='locale.set'),
url(r'^robots.txt$', pretix.presale.views.robots.robots_txt, name='robots.txt'),
url(r'^browserconfig.xml$', pretix.presale.views.theme.browserconfig_xml, name='browserconfig.xml'),
url(r'^site.webmanifest$', pretix.presale.views.theme.webmanifest, name='site.webmanifest'),
url(r'^widget/v1\.(?P<lang>[a-zA-Z0-9_\-]+)\.js$', pretix.presale.views.widget.widget_js, name='widget.js'),
re_path(r'^locale/set$', pretix.presale.views.locale.LocaleSet.as_view(), name='locale.set'),
re_path(r'^robots.txt$', pretix.presale.views.robots.robots_txt, name='robots.txt'),
re_path(r'^browserconfig.xml$', pretix.presale.views.theme.browserconfig_xml, name='browserconfig.xml'),
re_path(r'^site.webmanifest$', pretix.presale.views.theme.webmanifest, name='site.webmanifest'),
re_path(r'^widget/v1\.(?P<lang>[a-zA-Z0-9_\-]+)\.js$', pretix.presale.views.widget.widget_js, name='widget.js'),
]

View File

@@ -230,7 +230,7 @@ def _detect_event(request, require_live=True, require_plugin=None):
if hasattr(request, 'event'):
# Restrict locales to the ones available for this event
LocaleMiddleware().process_request(request)
LocaleMiddleware(NotImplementedError).process_request(request)
if require_live and not request.event.live:
can_access = (
@@ -267,7 +267,7 @@ def _detect_event(request, require_live=True, require_plugin=None):
return response
elif hasattr(request, 'organizer'):
# Restrict locales to the ones available for this organizer
LocaleMiddleware().process_request(request)
LocaleMiddleware(NotImplementedError).process_request(request)
except Event.DoesNotExist:
try: