electora-vote / electora-app

Decentralized Voting Application - leveraging the power of zk-proofs, conditions based decryption, and decentralized storage
https://app.electora.eu/
8 stars 2 forks source link

Prevent users from submitting votes after the endtime #93

Closed sweep-ai[bot] closed 1 year ago

sweep-ai[bot] commented 1 year ago

Description

This PR adds functionality to prevent users from submitting votes after the end time of a ballot in the Electora decentralized voting application. The Cast Vote Button will be disabled when the ballot's ends_at time has passed.

Summary of Changes

Please review and merge this PR to prevent users from casting votes after the end time of a ballot.

Fixes #92.


To checkout this PR branch, run the following command in your terminal:

git checkout sweep/prevent-votes-after-endtime

🎉 Latest improvements to Sweep:


💡 To get Sweep to edit this pull request, you can:

what-the-diff[bot] commented 1 year ago

PR Summary

theref commented 1 year ago

Sweep: Could you also add a status to the ballot page please? The status should depend on the new has_ended and be coloured depending on status. Thank you

sweep-ai[bot] commented 1 year ago

Sweep: Could you also add a status to the ballot page please? The status should depend on the new has_ended and be coloured depending on status. Thank you

Hi @theref,

I decided to make the following changes:

File Path Proposed Changes
client_code/forms/routes/ballot/Read/__init__.py Modify client_code/forms/routes/ballot/Read/init.py with contents:
• Add a new label component to the ballot page to display the status. Name this label as status_label.
• In the __init__ method, after the line where the vote button is enabled or disabled, add a condition to check the has_ended method of the ballot.
• If the has_ended method returns True, set the text of the status_label to "Ended" and its color to red.
• If the has_ended method returns False, set the text of the status_label to "Ongoing" and its color to green.