mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Upgrade to Django 3.2 (#2056)
This commit is contained in:
@@ -32,19 +32,10 @@
|
||||
# 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.apps import AppConfig
|
||||
from django.urls import URLPattern
|
||||
from django.urls.resolvers import RegexPattern
|
||||
|
||||
|
||||
class PretixMultidomainConfig(AppConfig):
|
||||
name = 'pretix.multidomain'
|
||||
label = 'pretixmultidomain'
|
||||
|
||||
|
||||
default_app_config = 'pretix.multidomain.PretixMultidomainConfig'
|
||||
|
||||
|
||||
def event_url(route, view, name=None, require_live=True):
|
||||
if callable(view):
|
||||
pattern = RegexPattern(route, name=name, is_endpoint=True)
|
||||
|
||||
40
src/pretix/multidomain/apps.py
Normal file
40
src/pretix/multidomain/apps.py
Normal file
@@ -0,0 +1,40 @@
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
|
||||
# This file is based on an earlier version of pretix which was released under the Apache License 2.0. The full text of
|
||||
# the Apache License 2.0 can be obtained at <http://www.apache.org/licenses/LICENSE-2.0>.
|
||||
#
|
||||
# This file may have since been changed and any changes are released under the terms of AGPLv3 as described above. A
|
||||
# full history of changes and contributors is available at <https://github.com/pretix/pretix>.
|
||||
#
|
||||
# This file contains Apache-licensed contributions copyrighted by: Tobias Kunze
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software distributed under the Apache License 2.0 is
|
||||
# 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.apps import AppConfig
|
||||
|
||||
|
||||
class PretixMultidomainConfig(AppConfig):
|
||||
name = 'pretix.multidomain'
|
||||
label = 'pretixmultidomain'
|
||||
@@ -22,15 +22,15 @@
|
||||
import importlib.util
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf.urls import include, url
|
||||
from django.conf.urls import include, re_path
|
||||
|
||||
from pretix.multidomain.plugin_handler import plugin_event_urls
|
||||
from pretix.presale.urls import event_patterns, locale_patterns
|
||||
from pretix.urls import common_patterns
|
||||
|
||||
presale_patterns = [
|
||||
url(r'', include((locale_patterns + [
|
||||
url(r'', include(event_patterns)),
|
||||
re_path(r'', include((locale_patterns + [
|
||||
re_path(r'', include(event_patterns)),
|
||||
], 'presale')))
|
||||
]
|
||||
|
||||
@@ -42,11 +42,11 @@ for app in apps.get_app_configs():
|
||||
if hasattr(urlmod, 'event_patterns'):
|
||||
patterns = plugin_event_urls(urlmod.event_patterns, plugin=app.name)
|
||||
raw_plugin_patterns.append(
|
||||
url(r'', include((patterns, app.label)))
|
||||
re_path(r'', include((patterns, app.label)))
|
||||
)
|
||||
|
||||
plugin_patterns = [
|
||||
url(r'', include((raw_plugin_patterns, 'plugins')))
|
||||
re_path(r'', include((raw_plugin_patterns, 'plugins')))
|
||||
]
|
||||
|
||||
# The presale namespace comes last, because it contains a wildcard catch
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
import importlib.util
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf.urls import include, url
|
||||
from django.conf.urls import include, re_path
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from pretix.multidomain.plugin_handler import plugin_event_urls
|
||||
@@ -45,10 +45,10 @@ from pretix.presale.urls import (
|
||||
from pretix.urls import common_patterns
|
||||
|
||||
presale_patterns_main = [
|
||||
url(r'', include((locale_patterns + [
|
||||
url(r'^(?P<organizer>[^/]+)/', include(organizer_patterns)),
|
||||
url(r'^(?P<organizer>[^/]+)/(?P<event>[^/]+)/', include(event_patterns)),
|
||||
url(r'^$', TemplateView.as_view(template_name='pretixpresale/index.html'), name="index")
|
||||
re_path(r'', include((locale_patterns + [
|
||||
re_path(r'^(?P<organizer>[^/]+)/', include(organizer_patterns)),
|
||||
re_path(r'^(?P<organizer>[^/]+)/(?P<event>[^/]+)/', include(event_patterns)),
|
||||
re_path(r'^$', TemplateView.as_view(template_name='pretixpresale/index.html'), name="index")
|
||||
], 'presale')))
|
||||
]
|
||||
|
||||
@@ -62,18 +62,18 @@ for app in apps.get_app_configs():
|
||||
single_plugin_patterns += urlmod.urlpatterns
|
||||
if hasattr(urlmod, 'event_patterns'):
|
||||
patterns = plugin_event_urls(urlmod.event_patterns, plugin=app.name)
|
||||
single_plugin_patterns.append(url(r'^(?P<organizer>[^/]+)/(?P<event>[^/]+)/',
|
||||
include(patterns)))
|
||||
single_plugin_patterns.append(re_path(r'^(?P<organizer>[^/]+)/(?P<event>[^/]+)/',
|
||||
include(patterns)))
|
||||
if hasattr(urlmod, 'organizer_patterns'):
|
||||
patterns = urlmod.organizer_patterns
|
||||
single_plugin_patterns.append(url(r'^(?P<organizer>[^/]+)/',
|
||||
include(patterns)))
|
||||
single_plugin_patterns.append(re_path(r'^(?P<organizer>[^/]+)/',
|
||||
include(patterns)))
|
||||
raw_plugin_patterns.append(
|
||||
url(r'', include((single_plugin_patterns, app.label)))
|
||||
re_path(r'', include((single_plugin_patterns, app.label)))
|
||||
)
|
||||
|
||||
plugin_patterns = [
|
||||
url(r'', include((raw_plugin_patterns, 'plugins')))
|
||||
re_path(r'', include((raw_plugin_patterns, 'plugins')))
|
||||
]
|
||||
|
||||
# The presale namespace comes last, because it contains a wildcard catch
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
import importlib.util
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf.urls import include, url
|
||||
from django.conf.urls import include, re_path
|
||||
|
||||
from pretix.multidomain.plugin_handler import plugin_event_urls
|
||||
from pretix.presale.urls import (
|
||||
@@ -31,9 +31,9 @@ from pretix.presale.urls import (
|
||||
from pretix.urls import common_patterns
|
||||
|
||||
presale_patterns = [
|
||||
url(r'', include((locale_patterns + [
|
||||
url(r'', include(organizer_patterns)),
|
||||
url(r'^(?P<event>[^/]+)/', include(event_patterns)),
|
||||
re_path(r'', include((locale_patterns + [
|
||||
re_path(r'', include(organizer_patterns)),
|
||||
re_path(r'^(?P<event>[^/]+)/', include(event_patterns)),
|
||||
], 'presale')))
|
||||
]
|
||||
|
||||
@@ -45,16 +45,16 @@ for app in apps.get_app_configs():
|
||||
if hasattr(urlmod, 'event_patterns'):
|
||||
patterns = plugin_event_urls(urlmod.event_patterns, plugin=app.name)
|
||||
raw_plugin_patterns.append(
|
||||
url(r'^(?P<event>[^/]+)/', include((patterns, app.label)))
|
||||
re_path(r'^(?P<event>[^/]+)/', include((patterns, app.label)))
|
||||
)
|
||||
if hasattr(urlmod, 'organizer_patterns'):
|
||||
patterns = urlmod.organizer_patterns
|
||||
raw_plugin_patterns.append(
|
||||
url(r'', include((patterns, app.label)))
|
||||
re_path(r'', include((patterns, app.label)))
|
||||
)
|
||||
|
||||
plugin_patterns = [
|
||||
url(r'', include((raw_plugin_patterns, 'plugins')))
|
||||
re_path(r'', include((raw_plugin_patterns, 'plugins')))
|
||||
]
|
||||
|
||||
# The presale namespace comes last, because it contains a wildcard catch
|
||||
|
||||
Reference in New Issue
Block a user