forked from CGM_Public/pretix_original
Import large package lazily to speed up startup (#5636)
* Import large package lazily to speed up startup * Make all jsonschema imports lazy
This commit is contained in:
@@ -47,7 +47,6 @@ from collections import OrderedDict, defaultdict
|
||||
from functools import partial
|
||||
from io import BytesIO
|
||||
|
||||
import jsonschema
|
||||
import pypdf
|
||||
import pypdf.generic
|
||||
import reportlab.rl_config
|
||||
@@ -1311,6 +1310,8 @@ def _correct_page_media_box(page: pypdf.PageObject):
|
||||
@deconstructible
|
||||
class PdfLayoutValidator:
|
||||
def __call__(self, value):
|
||||
import jsonschema
|
||||
|
||||
if not isinstance(value, dict):
|
||||
try:
|
||||
val = json.loads(value)
|
||||
|
||||
Reference in New Issue
Block a user