Closed sweep-ai[bot] closed 1 year ago
GitHub actions yielded the following error.
The command that failed is ruff --format=github .
. Here are the relevant lines from the logs:
##[error]client_code/forms/routes/vote/Cast/__init__.py:26:13: F821 Undefined name `anvil`
##[error]Process completed with exit code 1.
This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.
I'm getting the same errors 3 times in a row, so I will stop working on fixing this PR.
Date and Time Functionality Added
Dates and times are now being imported into client_code/forms/routes/ballot/Read/__init__.py
, client_code/forms/routes/vote/Cast/__init__.py
, and client_code/model.py
to support new functionality.
Ballot Status Display Implemented
New codes for ballot status has been incorporated in client_code/forms/routes/ballot/Read/__init__.py
to effectively display the status of ballots.
Ballot Status Method Added
A method to obtain the status of a ballot, get_ballot_status(self)
, has been created and included in the client_code/forms/routes/ballot/Read/__init__.py
.
New Voting Functionality Implemented
Implemented a conditional block of code (if-else) in the cast_button_click
method (found within client_code/forms/routes/vote/Cast/__init__.py
) to provide certain actions when a vote cast button is clicked.
Vote Status Method Added
A new method get_status(self)
was introduced to the client_code/model.py
to help retrieve the status of a vote.
GitHub actions yielded the following error.
The command that failed is ruff --format=github .
. Here are the relevant lines from the logs:
##[error]client_code/forms/routes/vote/Cast/__init__.py:26:13: F821 Undefined name `anvil`
##[error]Process completed with exit code 1.
This is likely a linting or type-checking issue with the source code. Update the code changed by the PR. Don't modify the existing tests.
The command that failed is
ruff --format=github .
. Here are the relevant lines from the logs:##[error]client_code/forms/routes/vote/Cast/__init__.py:26:13: F821 Undefined name `anvil` ##[error]Process completed with exit code 1.
Hi @sweep-ai[bot],
I decided to make the following changes:
File Path | Proposed Changes |
---|---|
client_code/forms/routes/vote/Cast/__init__.py |
Modify client_code/forms/routes/vote/Cast/init.py with contents: • At the beginning of the file, add the line import anvil to import the anvil module. |
Description
This PR addresses the following issues:
Changes Made
Cast
class inclient_code/forms/routes/vote/Cast/__init__.py
to include a check for the ballot end time before allowing a vote to be cast. The "Cast Vote" button is now disabled if the current time is past theends_at
time of the ballot.Read
class inclient_code/forms/routes/ballot/Read/__init__.py
to display the status of the ballot based on theends_at
time. If the current time is past theends_at
time, the status is displayed as "Ended" in red. Otherwise, the status is displayed as "Ongoing" in green.Ballot
class inclient_code/model.py
to determine the status of the ballot. The method returns "Ended" if the current time is past theends_at
time of the ballot, and "Ongoing" otherwise.Testing
Screenshots
Checklist
Fixes #92.
To checkout this PR branch, run the following command in your terminal:
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: