[web req] check latest url in breadcrumbs is not the same as the current one to keep more valuable information stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 11 Mar 2010 16:43:00 +0100
branchstable
changeset 4864 e77d3e95872d
parent 4863 f6cf0fcd40ae
child 4865 90ad729d3540
[web req] check latest url in breadcrumbs is not the same as the current one to keep more valuable information
web/request.py
--- a/web/request.py	Thu Mar 11 16:42:13 2010 +0100
+++ b/web/request.py	Thu Mar 11 16:43:00 2010 +0100
@@ -287,7 +287,11 @@
             if breadcrumbs is None:
                 breadcrumbs = SizeConstrainedList(10)
                 self.set_session_data('breadcrumbs', breadcrumbs)
-            breadcrumbs.append(self.url())
+                breadcrumbs.append(self.url())
+            else:
+                url = self.url()
+                if breadcrumbs[-1] != url:
+                    breadcrumbs.append(url)
 
     def last_visited_page(self):
         breadcrumbs = self.get_session_data('breadcrumbs', None)