diff options
Diffstat (limited to 'ishtar_common/views_item.py')
-rw-r--r-- | ishtar_common/views_item.py | 9 |
1 files changed, 5 insertions, 4 deletions
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" |