From: Bastian Germann Date: Sat, 3 Jun 2023 15:48:32 +0200 Forwarded: not-needed Subject: Change validation defaults Do not validate by default and change the schema location to a /etc place. The upstream schemas cannot be distributed in Debian main. --- sepaxml/shared.py | 2 +- sepaxml/validation.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sepaxml/shared.py b/sepaxml/shared.py index 251698b..3f3ad78 100644 --- a/sepaxml/shared.py +++ b/sepaxml/shared.py @@ -55,7 +55,7 @@ class SepaPaymentInitn: def _finalize_batch(self): raise NotImplementedError() - def export(self, validate=True, pretty_print=False): + def export(self, validate=False, pretty_print=False): """ Method to output the xml as string. It will finalize the batches and then calculate the checksums (amount sum and transaction count), diff --git a/sepaxml/validation.py b/sepaxml/validation.py index b3f8ba1..050bc61 100644 --- a/sepaxml/validation.py +++ b/sepaxml/validation.py @@ -8,7 +8,7 @@ class ValidationError(Exception): def try_valid_xml(xmlout, schema): import xmlschema # xmlschema does some weird monkeypatching in etree, if we import it globally, things fail try: - my_schema = xmlschema.XMLSchema(os.path.join(os.path.dirname(__file__), 'schemas', schema + '.xsd')) + my_schema = xmlschema.XMLSchema(os.path.join('/etc/python-sepaxml/schemas', schema + '.xsd')) my_schema.validate(xmlout.decode()) except xmlschema.XMLSchemaValidationError as e: