Tag 'v2.1' created by Pierre-Yves Chibon <pingou(a)pingoured.fr> at 2014-07-16
07:06 +0000
Release 2.1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iEUEABECAAYFAlPGJFwACgkQ2HRbBxDocwrCwgCXRa9vsjzNlHNQVTcji0nt9ZQ8
CACeJQKTBAVucTNx96W2IXzuD0d4RMU=
=GDRa
-----END PGP SIGNATURE-----
Changes since v2.0.2:
Pierre-Yves Chibon (162):
Update the content of the fedmsg.d folder, simplify it
Add a json compatible representation of an election object
Broadcast on fedmsg when an election is added or edited
Fix the conversion of the election objects into a json structure for fedmsg
Add method to convert a Candidate object into a json representation of it
Publish fedmsg messages upon adding, editing and deleting candidates
Move the index template one level up
Move the templates in the `election` folder one level up
Adjust the flask application for the new template paths
Remove the redirect.py file
Split the one controller into three
Give a warning information message to admins seeing an embargoed election
Make the runserver.py file executable
Remove import of the redirect file since the file no longer exists
Rename the column usefas to candidates_are_fasusers
Adjust the database mapping of candidates_are_fasusers to its type in the DB
Remove current tests
Make the minimal flask version be 0.10
pep8 fixes on the controllers
Add default datetime in the timestamp field of the Vote table
Format the start and end dates in the json representation of an election
Order votes by timestamp
Ignore a small piece of the createdb function in the unit-tests
Add first code for the unit-tests
Add unit-tests for the Election object
Add unit-tests for the Candidate object
Add unit-tests for the Vote object
Add a local nosetests script ensuring we run the proper version of the libraries
Add the runtest.sh script for easy testings of the project
Ignore the .coverage file created when running the tests with coverage
Ignore reading the config file specified by environment variable
Add missing docstrings
Ignore some other lines in the unit-tests coverage report
Add some more votes on the election #3
Add unit-tests for the generic flask endpoints
Ignore fedmsg in the unit-tests
Add a generic unit-test class for the Flask tests
Port the flask applications to the ModelFlasktests class
Update the auth_login method to remove duplicated checks
Do not show voting page on election embargoed, these are just ended embargoed
Remove double spaces on a flashed message
Add missing spaces in flashed messages
Add missing import in the elections controller
Add a new simple and open election and adjust the tests to this election
Add candidates to the new election having simple voting
Add votes to the new election #5 with simple voting
Add missing shebang to the runserver.py script
Adjust the flask tests to new election added
Ignore case where we don't know the election's voting type for the
unit-tests
Add candidates to the election #3 and adjust the candidate.id
Adjust the candidate.id for the candidates that were added to elections #3
Ignore case where we would not get a valid election object from get_valid_election
Fix typo in the Preview (in case of wrong input)
In case the input is invalid (not an int), the next_action is vote
Ignore FAS integration for the unit-tests
Handle the case the id submitted is not an integer
Fix the simple voting, make sure the candidate submitted belong to the election
Ignore FAS integration for the unit-tests
Ignore in the unit-test the possibility that get_valid_election does not return an
election
One more place where we do not want to cover FAS integration in the unit-tests
Add unit-tests for the elections controller
Remove un-used imports
Add couple of candidates to the election #4
Handle error if someone tries to delete a candidate that already has votes
Update the behavior of the ForeinKey upon update or delete
Add unit-tests for the admin controller
Fix import and session for the unit-tests for the elections and admin controllers
Add a little bit of documentation in the admin tests
Add missing import and fix the validate_shortdesc to actually be used
Add tests for the form fields validations when creating a new elections
Fix the database session for the forms, if we want the tests to run :)
Fix dependency in setup.py, the package is named kitchen not python-kitchen
Specify where to find the tests so that python setup.py test works
Adjust the requirements file
Convert the boolean into integer as in the DB model (and required by postgresql)
pep8 fixes on fedora_elections
pep8 fixes on setup.py
pep8 fixes on the tests
Change comment as suggested by @abadger
'##' is not allowed, and @abadger is right '# #' doesn't look
right either
Remove un-used script
Add elections.proxy and set elections as an application behind a reverse proxy
Fix the reverse proxy
Implement the election admin groups
Make the tests pass offline
Elections admins are now admins of every elections
Enhance coverage of the is_admin function
Specify an admin group for the election #2
Test the is_election_admin when the user is and is not in an AdminGroup of that
election
Sort the election's admin groups
Add unit-test testing the addition and removal of admin groups when editing an
election
Add unit-tests for the is_safe_url method
pep8 fixes
Explain a little what the admin groups are
No need to have different URL for the different voting type, one is enough
Adjust the action url in the vote templates now that there is a unique URL for
voting
Adjust unit-tests to the unique URL for voting
Simplify vote_range and vote_simple since they are no longer flask endpoints
Implement legal_voters adding/editing/deleting
Voting to an election requires CLA+1 at minimum
Use safe_redirect_back instead of forcing the return to index
If there are legal voters and the user is not one of them, redirect him/her back
Add test for the redirect from the voting page is the user did not sign the CLA
Fix the @login_required to check to cla_done and groups > 0
Fix the unit-tests so that the FakeFasUser used has at least 1 group
Add test checking the error message if the user has 0 groups
Specify a group of user allowed to vote on election #3
Adjust the tests so that the FakeFasUser is part of the group allowed to vote
Add test for editing an election with legal voters
Add test checking the behavior when the user is not part of the LegalVoters
Split the tests for editing admin groups or legal voters into their own method
Cover adding admin groups when testing admin_new_election
Avoid adding empty legal voter groups
Show the actual results in the result page
Comment the logic of the conditions to select where to place the limit
Let's be a little more precise/concrete about what the check allows
Add dynamically generated form used for range voting
Add macro to render the choices when confirming a vote
Update the range voting method to relying on a wtforms form
Adjust the range voting form to make use of the wtforms form created for it
Allow to vote up to the number of candidates
Fix the tests for the change in range voting
Rename get_voting_range_form to get_range_voting_form and VotingRange to
RangeVoting
Add forms.get_simple_voting_form that dynamically generate the form for simple
voting
Port the simple voting logic to use the forms just created
Adjust the simple voting template to rely on the form just added
Use candidate instead of candidates to be consistent with the old behavior
Ignore the [more] link for the candidates for the moment, we need a better solution
Fix the tests for the change in the simple voting processing and integration of
wtforms
No layout change when confirming for the moment
If there is a usernamemap specified, use it instead of the field label
Fixed presenting the fields of the form with their appropriate label/value
Drop the cand_name dict as we already have the usernamemap dict
Fill in the usernamemap for all the candidates
The form now provides the candidate id directly as value (instead of its name
before)
Allow to rely on the usernamemap also in render_field_in_row
Make use the usernamemap for range voting
The usernamemap converts the field label (username) for FAS full names
Simple voting directly use the candidate identifier now, adjust the tests
accordingly
Have the vote_range function accept a max_range argument
Update the information message according to the type of voting used for this
election
Offer the simplified range voting (max range = 3) in the options when creating an
election
If the election is of type range_3, call the appropriately vote_range
Add a form for SelectVoting
Add select voting as an option when creating an election
Add the logic for vote select
Add a max_votes field in the election table
Add the max_votes field in the election form
Adjust the edit and view election templates to display the max_votes field/info
Use the max_votes field of the election to set the maximum ranges or vote
The simple voting form has no use of the maximum votes/range
Add basic alembic structure for alembic integration
Add sample alembic.ini file in the files folder
Ignore alembic.ini files
Add alembic revision adding max_votes to the elections table
Small pep8 fixes
Take the max_votes into account when creating an election
Take into account max_votes when editing an election
Include the alembic files in the sources
Install the alembic files in the spec
Install the sample/default alembic.ini file as no-replace
Bump to 2.1
---
.gitignore | 2
MANIFEST.in | 1
alembic/env.py | 72 +
alembic/script.py.mako | 22
alembic/versions/d07c5ef2d03_add_max_votes_to_ele.py | 28
fedmsg.d/base.py | 39
fedmsg.d/elections.py | 20
fedmsg.d/endpoints.py | 44
fedmsg.d/ssl.py | 41
fedora_elections/__init__.py | 563 ------------
fedora_elections/admin.py | 393 ++++++++
fedora_elections/default_config.py | 1
fedora_elections/elections.py | 361 +++++++
fedora_elections/fedmsgshim.py | 2
fedora_elections/forms.py | 79 +
fedora_elections/models.py | 120 ++
fedora_elections/proxy.py | 65 +
fedora_elections/redirect.py | 23
fedora_elections/static/elections.css | 13
fedora_elections/templates/_formhelpers.html | 33
fedora_elections/templates/about.html | 40
fedora_elections/templates/admin/election_form.html | 3
fedora_elections/templates/admin/view_election.html | 3
fedora_elections/templates/archive.html | 29
fedora_elections/templates/election/about.html | 40
fedora_elections/templates/election/archive.html | 29
fedora_elections/templates/election/results.html | 65 -
fedora_elections/templates/election/vote_range.html | 116 --
fedora_elections/templates/election/vote_simple.html | 53 -
fedora_elections/templates/index.html | 66 +
fedora_elections/templates/list/index.html | 70 -
fedora_elections/templates/results.html | 93 ++
fedora_elections/templates/vote_range.html | 99 ++
fedora_elections/templates/vote_simple.html | 46 +
files/alembic.ini | 54 +
files/fedora-elections.spec | 25
files/update_1_to_2.sql | 6
nosetests | 10
requirements.txt | 6
runserver.py | 1
runtests.sh | 4
setup.py | 5
testing | 3
tests/__init__.py | 180 +++
tests/base.py | 59 -
tests/test_candidate.py | 202 ++++
tests/test_election.py | 287 ++++++
tests/test_flask.py | 312 ++++++
tests/test_flask_admin.py | 860 +++++++++++++++++++
tests/test_flask_elections.py | 682 +++++++++++++++
tests/test_smoke.py | 100 --
tests/test_vote.py | 214 ++++
52 files changed, 4443 insertions(+), 1241 deletions(-)
---