diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-04-10 12:28:42 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2011-04-10 12:28:42 +0200 |
commit | 210c91c1cb05f74c574f4fd28e23e5f1622afaa2 (patch) | |
tree | 47d90976b77a7e937837e6cd90c701959e259645 /ishtar/furnitures/views.py | |
parent | 412e1567c453509ca980ea1350f20e89db612f7a (diff) | |
download | Ishtar-210c91c1cb05f74c574f4fd28e23e5f1622afaa2.tar.bz2 Ishtar-210c91c1cb05f74c574f4fd28e23e5f1622afaa2.zip |
Better history management: don't save identical version of the history (refs #349)
Diffstat (limited to 'ishtar/furnitures/views.py')
-rw-r--r-- | ishtar/furnitures/views.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py index 43e663267..8dea8cb2f 100644 --- a/ishtar/furnitures/views.py +++ b/ishtar/furnitures/views.py @@ -285,7 +285,6 @@ def show_item(model, name): return HttpResponse(None) doc_type = 'type' in dct and dct.pop('type') date = 'date' in dct and dct.pop('date') - dct['item'], dct['item_name'] = item, name dct['window_id'] = "%s-%d-%s" % (name, item.pk, datetime.datetime.now().strftime('%M%s')) if date: @@ -299,8 +298,11 @@ def show_item(model, name): dct['next'] = item._next else: historized = item.history.all() + if historized: + item.history_date = historized[0].history_date if len(historized) > 1: dct['previous'] = historized[1].history_date + dct['item'], dct['item_name'] = item, name context_instance = RequestContext(request) context_instance.update(dct) n = datetime.datetime.now() |