mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
Refs #40 -- Removed Python 3.2/3.3 support
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
import importlib.util
|
||||
import sys
|
||||
|
||||
|
||||
def module_exists(modname):
|
||||
if sys.version_info[0:1] >= (3, 4):
|
||||
return bool(importlib.util.find_spec(modname))
|
||||
else:
|
||||
return bool(importlib.find_loader(modname))
|
||||
@@ -42,7 +42,7 @@
|
||||
</form>
|
||||
{% else %}
|
||||
<div class="alert alert-error">
|
||||
{% trans "HBCI is only available with Python 3.3 or newer and with aqbanking-cli and aqhbci-tool4 installed." %}
|
||||
{% trans "HBCI is only available with aqbanking-cli and aqhbci-tool4 installed." %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -108,12 +108,9 @@ class ImportView(EventPermissionRequiredMixin, TemplateView):
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
ctx = super().get_context_data(**kwargs)
|
||||
if sys.version_info[:2] >= (3, 3):
|
||||
ctx['hbci_available'] = shutil.which('aqbanking-cli') and shutil.which('aqhbci-tool4')
|
||||
if ctx['hbci_available']:
|
||||
ctx['hbci_form'] = self.hbci_form
|
||||
else:
|
||||
ctx['hbci_available'] = False
|
||||
ctx['hbci_available'] = shutil.which('aqbanking-cli') and shutil.which('aqhbci-tool4')
|
||||
if ctx['hbci_available']:
|
||||
ctx['hbci_form'] = self.hbci_form
|
||||
return ctx
|
||||
|
||||
def process_csv_file(self):
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import importlib
|
||||
import importlib.util
|
||||
|
||||
from django.apps import apps
|
||||
from django.conf import settings
|
||||
@@ -6,7 +7,6 @@ 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')),
|
||||
@@ -23,7 +23,7 @@ if settings.DEBUG:
|
||||
pluginpatterns = []
|
||||
for app in apps.get_app_configs():
|
||||
if hasattr(app, 'PretixPluginMeta'):
|
||||
if module_exists(app.name + '.urls'):
|
||||
if importlib.util.find_spec(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