From d0e31acb2cfb5c7300d3f8b833219b756577d73b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 10 Apr 2011 12:28:42 +0200 Subject: Better history management: don't save identical version of the history (refs #349) --- ishtar/furnitures/views.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ishtar/furnitures/views.py') 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() -- cgit v1.2.3