| |
@@ -237,6 +237,17 @@
|
| |
return (len(vote['+1']), len(vote['0']), len(vote['-1']))
|
| |
|
| |
|
| |
+ def user_voted(bug_votes):
|
| |
+ if not g.fas_user:
|
| |
+ return False
|
| |
+
|
| |
+ voters = set()
|
| |
+ for tracker_votes in bug_votes.values():
|
| |
+ voters.update(itertools.chain(*tracker_votes.values()))
|
| |
+
|
| |
+ return g.fas_user.username in voters
|
| |
+
|
| |
+
|
| |
def web_voting_info(bugz, milestone):
|
| |
"""Returns voting tuple for each bug and each section in web UI,
|
| |
a dict in dict structure in format:
|
| |
@@ -258,7 +269,8 @@
|
| |
'Accepted Freeze Exceptions': vote_count_tuple(votes, f'{milestone}freezeexception'),
|
| |
'Accepted 0-day Blockers': vote_count_tuple(votes, '0day'),
|
| |
'Accepted Previous Release Blockers': vote_count_tuple(votes, 'previousrelease'),
|
| |
- 'Prioritized Bugs': None # no discussion for prioritized bugs
|
| |
+ 'Prioritized Bugs': None, # no discussion for prioritized bugs
|
| |
+ 'user_voted': user_voted(votes),
|
| |
}
|
| |
return voting_info
|
| |
|
| |
Fix for #174
This PR includes a change proposed by @lruzicka: show if user already voted.