# HG changeset patch # User Sylvain Thénault # Date 1258030406 -3600 # Node ID 9674d62a54f9d0f55be845524bacb6ed12e6fa7d # Parent 335e40fdb5a5beefee854427b2013806f32e56ac close #474415 by using 'is' instead of comparison which explicitly fails on entity classes diff -r 335e40fdb5a5 -r 9674d62a54f9 web/views/timetable.py --- a/web/views/timetable.py Thu Nov 12 13:46:47 2009 +0100 +++ b/web/views/timetable.py Thu Nov 12 13:53:26 2009 +0100 @@ -36,14 +36,13 @@ dates = {} users = [] users_max = {} - # XXX: try refactoring with calendar.py:OneMonthCal for row in xrange(self.rset.rowcount): task = self.rset.get_entity(row, 0) - if len(self.rset[row])>1: + if len(self.rset[row]) > 1: user = self.rset.get_entity(row, 1) else: - user = u"*" + user = ALL_USERS the_dates = [] if task.start and task.stop: if task.start.toordinal() == task.stop.toordinal(): @@ -137,10 +136,10 @@ columns = [] for user, width in zip(users, widths): self.w(u'' % max(MIN_COLS, width)) - if user != u"*": + if user is ALL_USERS: + self.w('*') + else: user.view('oneline', w=self.w) - else: - self.w(user) self.w(u'') self.w(u'\n') return columns