From: Robert Lehmann Date: Fri, 26 Nov 2010 08:48:43 +0000 (+0100) Subject: Add `mine' sorting criteria showing bugs assigned to yourself first. X-Git-Tag: 1.1.0~245^2~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7729c7f383817599fa3fe75f01addd8afb49a984;p=be.git Add `mine' sorting criteria showing bugs assigned to yourself first. --- diff --git a/libbe/bug.py b/libbe/bug.py index 5361e4a..d0914b4 100644 --- a/libbe/bug.py +++ b/libbe/bug.py @@ -799,6 +799,12 @@ cmp_extra_strings = lambda bug_1, bug_2 : cmp_attr(bug_1, bug_2, "extra_strings" # chronological rankings (newer < older) cmp_time = lambda bug_1, bug_2 : cmp_attr(bug_1, bug_2, "time", invert=True) +def cmp_mine(bug_1, bug_2): + user_id = libbe.ui.util.user.get_user_id(bug_1.storage) + mine_1 = bug_1.assigned != user_id + mine_2 = bug_2.assigned != user_id + return cmp(mine_1, mine_2) + def cmp_comments(bug_1, bug_2): """ Compare two bugs' comments lists. Doesn't load any new comments,