mirror of
https://github.com/pretix/pretix.git
synced 2026-05-06 15:24:02 +00:00
Fixed Python 3.2/3.3 compatibility
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import importlib.util
|
||||
import importlib
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
@@ -6,6 +6,7 @@ from django.conf.urls import include, url
|
||||
|
||||
import pretix.control.urls
|
||||
import pretix.presale.urls
|
||||
from pretix.helpers.importlib import module_exists
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^control/', include(pretix.control.urls, namespace='control')),
|
||||
@@ -22,7 +23,7 @@ if settings.DEBUG:
|
||||
pluginpatterns = []
|
||||
for app in apps.get_app_configs():
|
||||
if hasattr(app, 'PretixPluginMeta'):
|
||||
if importlib.util.find_spec(app.name + '.urls'):
|
||||
if module_exists(app.name + '.urls'):
|
||||
urlmod = importlib.import_module(app.name + '.urls')
|
||||
pluginpatterns.append(
|
||||
url(r'', include(urlmod, namespace=app.label))
|
||||
|
||||
Reference in New Issue
Block a user