From 8ee253c715bbfb8175a1fa2ca83334a774b01941 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 2 Oct 2023 19:06:05 +0200 Subject: ✨ import sheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/views_item.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ishtar_common/views_item.py') diff --git a/ishtar_common/views_item.py b/ishtar_common/views_item.py index 7ca1f4b59..7596f493f 100644 --- a/ishtar_common/views_item.py +++ b/ishtar_common/views_item.py @@ -435,10 +435,11 @@ def show_item(model, name, extra_dct=None, model_for_perms=None): dct.update(extra_dct(request, item)) context_instance = deepcopy(dct) context_instance["output"] = "html" - if hasattr(item, "history_object"): - filename = item.history_object.associated_filename - else: - filename = item.associated_filename + if hasattr(item, "associated_filename"): + if hasattr(item, "history_object"): + filename = item.history_object.associated_filename + else: + filename = item.associated_filename if doc_type == "odt" and settings.ODT_TEMPLATE: tpl = loader.get_template("ishtar/sheet_%s.html" % name) context_instance["output"] = "ODT" -- cgit v1.2.3