Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with wrong poll being highlighted. #53

Merged
merged 5 commits into from
Mar 14, 2019

Conversation

xitij2000
Copy link
Member

A recent PR changed the order in which results were presented, however, the styling code still assumed that the first entry would have the highest vote count and highlighted the first entry.

This change fixes that an makes a subtle enhancement that will now style all top/leading entries.

poll/poll.py Outdated
@@ -508,6 +511,7 @@ def tally_detail(self):
answer['choice'] = True
try:
answer['percent'] = round(answer['count'] / float(total) * 100)
answer['leader'] = answer['count'] == highest_count
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be outside the try/except to keep the block explicitly catching the lines where that error might happen?

Copy link
Contributor

@xirdneh xirdneh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

  • I tested this:
    • Ran this on local devstack.
  • I read through the code
  • [ ] I checked for accessibility issues
  • [ ] Includes documentation
  • [ ] I made sure any change in configuration variables is reflected in the corresponding
    client's configuration-secure repository

@xitij2000 xitij2000 merged commit 2c385b9 into master Mar 14, 2019
@xitij2000 xitij2000 deleted the kshitij/poll-colour-fix branch March 14, 2019 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants