diff options
author | Robert Lehmann <mail@robertlehmann.de> | 2010-11-26 09:48:43 +0100 |
---|---|---|
committer | Robert Lehmann <mail@robertlehmann.de> | 2010-11-26 09:48:43 +0100 |
commit | 7729c7f383817599fa3fe75f01addd8afb49a984 (patch) | |
tree | 3651f69cd429d76a86090af6087b5a0caf95929a | |
parent | 5d8e5bf31fa4035d8c45300244432de7d772832e (diff) | |
download | bugseverywhere-7729c7f383817599fa3fe75f01addd8afb49a984.tar.gz |
Add `mine' sorting criteria showing bugs assigned to yourself first.
-rw-r--r-- | libbe/bug.py | 6 |
1 files changed, 6 insertions, 0 deletions
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, |