Allow to ignore plugin conflicts via environment

This commit is contained in:
Raphael Michel
2019-12-13 12:57:25 +01:00
parent 282ad2c869
commit 1d36ef3c24
2 changed files with 3 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
import os
import sys
from enum import Enum
from typing import List
@@ -51,7 +52,7 @@ class PluginConfig(AppConfig):
if not hasattr(self, 'PretixPluginMeta'):
raise ImproperlyConfigured("A pretix plugin config should have a PretixPluginMeta inner class.")
if hasattr(self.PretixPluginMeta, 'compatibility') and not self.IGNORE:
if hasattr(self.PretixPluginMeta, 'compatibility') and not os.environ.get("PRETIX_IGNORE_CONFLICTS") == "True":
import pkg_resources
try:
pkg_resources.require(self.PretixPluginMeta.compatibility)

View File

@@ -42,15 +42,14 @@ except:
class CustomBuild(build):
def run(self):
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "pretix.settings")
os.environ.setdefault("PRETIX_IGNORE_CONFLICTS", "True")
import django
django.setup()
from django.conf import settings
from django.core import management
from pretix.base.plugins import PluginConfig
settings.COMPRESS_ENABLED = True
settings.COMPRESS_OFFLINE = True
PluginConfig.IGNORE = True
management.call_command('compilemessages', verbosity=1)
management.call_command('compilejsi18n', verbosity=1)