# HG changeset patch # User Aurelien Campeas # Date 1322150409 -3600 # Node ID f9fa2f47572c2d49b7140e862beeb338def5121d # Parent 21918a60a5c550658445c813a550b4acd48d94e2 [sorted navigation] refactor code so that when an attribute is found, nb_chars may be recomputed anyway according to variable type diff -r 21918a60a5c5 -r f9fa2f47572c web/views/navigation.py --- a/web/views/navigation.py Thu Nov 24 16:59:32 2011 +0100 +++ b/web/views/navigation.py Thu Nov 24 17:00:09 2011 +0100 @@ -231,10 +231,11 @@ relvar = rel.children[0].variable col = relvar.selected_index() if col is not None: - return col, attrname - # no relation but maybe usable anyway if selected - col = var.selected_index() - attrname = None + break + else: + # no relation but maybe usable anyway if selected + col = var.selected_index() + attrname = None if col is not None: # if column type is date[time], set proper 'nb_chars' if var.stinfo['possibletypes'] & frozenset(('TZDatetime', 'Datetime',