diff options
-rw-r--r-- | archaeological_operations/tests.py | 5 | ||||
-rw-r--r-- | ishtar_common/models.py | 2 | ||||
-rw-r--r-- | ishtar_common/templates/blocks/DataTables-content.html | 2 | ||||
-rw-r--r-- | ishtar_common/utils_secretary.py | 2 |
4 files changed, 7 insertions, 4 deletions
diff --git a/archaeological_operations/tests.py b/archaeological_operations/tests.py index 9cb715a6f..bb8c02c78 100644 --- a/archaeological_operations/tests.py +++ b/archaeological_operations/tests.py @@ -2449,7 +2449,10 @@ class LabelTest(TestCase, OperationInitTest): z = zipfile.ZipFile(f) self.assertIsNone(z.testzip()) content = z.open('content.xml') - self.assertIn(b'1789', content.read()) + full_content = content.read() + self.assertIn(b'1789', full_content) + # jpe file are added for missing pictures / must be filtered + self.assertNotIn(b'.jpe"', full_content) finally: if content: content.close() diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 0e68bf7dd..94d8744e5 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3665,7 +3665,7 @@ class DocumentTemplate(models.Model): break obj = objects[c_idx] values["items"].append(obj.get_values()) - engine = SecretaryRenderer() + engine = IshtarSecretaryRenderer() try: result = engine.render(self.template, **values) except TemplateSyntaxError as e: diff --git a/ishtar_common/templates/blocks/DataTables-content.html b/ishtar_common/templates/blocks/DataTables-content.html index 82da411e1..814e10c18 100644 --- a/ishtar_common/templates/blocks/DataTables-content.html +++ b/ishtar_common/templates/blocks/DataTables-content.html @@ -44,7 +44,7 @@ <button id="export-labels-{{name}}" type="button" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> - {% trans 'Labels'%} + {% trans 'Labels' context 'To be print' %} </button> <div class="dropdown-menu" aria-labelledby="export-labels-{{name}}"> {% for template in current_model.label_templates %} diff --git a/ishtar_common/utils_secretary.py b/ishtar_common/utils_secretary.py index 972b7d223..f1266b856 100644 --- a/ishtar_common/utils_secretary.py +++ b/ishtar_common/utils_secretary.py @@ -49,7 +49,7 @@ class IshtarSecretaryRenderer(Renderer): def ishtar_media_loader(self, media, *args, **kwargs): res = self.fs_loader(media, *args, **kwargs) - if not res: + if not res or not res[0]: return image_file, mime = res if "width" in kwargs: |