From 011db0c380a07ed03b1068ab80dc0f266a190acf Mon Sep 17 00:00:00 2001 From: Jochem Kuijpers Date: Wed, 3 Jul 2019 17:10:48 +0200 Subject: [PATCH 1/3] Add a title attribute to status image icons matching their alt attribute. Update README.rst Remove broken link to image that was at .. image:: http://shieldkins.elrod.me/fedora/nuancier Update development.rst Change yum to dnf Update manual install directions Co-Authored-By: Clement Verna Use Python3 Remove , sshfs_opts_append: "-o nonempty" since the nonempty option is no longer available. Update Vagrantfile.example --- README.rst | 33 ++++++++++++++----- Vagrantfile.example | 12 +++---- .../ansible/roles/nuancier-dev/tasks/main.yml | 22 ++++++++----- doc/deployment.rst | 4 +-- doc/development.rst | 4 +-- nuancier/templates/admin_index.html | 6 ++++ nuancier/templates/admin_review.html | 5 ++- nuancier/templates/admin_review_ro.html | 5 ++- nuancier/templates/contributions.html | 3 ++ nuancier/templates/elections_list.html | 6 ++++ 10 files changed, 71 insertions(+), 29 deletions(-) diff --git a/README.rst b/README.rst index 89b0f7b..bbd85d5 100644 --- a/README.rst +++ b/README.rst @@ -1,8 +1,6 @@ nuancier ======== -.. image:: http://shieldkins.elrod.me/fedora/nuancier - :Author: Pierre-Yves Chibon @@ -61,7 +59,7 @@ The best way to set up a development enviroment is to use `Vagrant Admin interface {% if election.submission_open %} Submission open {% else %} Submission closed {% endif %} {{ election.submission_date_start }} @@ -49,9 +51,11 @@

Admin interface

{% if election.election_open %} Election open {% else %} Election closed {% endif %} {{ election.election_date_start }} @@ -59,9 +63,11 @@

Admin interface

{% if election.election_public %} Election's results published {% else %} Election's results closed {% endif %} {{ election.election_date_end }} diff --git a/nuancier/templates/admin_review.html b/nuancier/templates/admin_review.html index 62efffa..d892b4e 100644 --- a/nuancier/templates/admin_review.html +++ b/nuancier/templates/admin_review.html @@ -22,7 +22,7 @@

Review election: {{ election.election_name }} - {{ election.election_year }}

Overview

Here below are presented all the candidates of the election {{ election.election_name }} -from {{ election.election_year }}, regardless of wether they are valid +from {{ election.election_year }}, regardless of whether they are valid candidates or not.

@@ -111,12 +111,15 @@

Overview

{% if candidate.approved == true%} Candidate approved {% elif candidate.denied == true %} Candidate denied {% else %} Candidate Pending Review {% endif %} diff --git a/nuancier/templates/admin_review_ro.html b/nuancier/templates/admin_review_ro.html index 208fd2c..c0e1c56 100644 --- a/nuancier/templates/admin_review_ro.html +++ b/nuancier/templates/admin_review_ro.html @@ -22,7 +22,7 @@

Review election: {{ election.election_name }} - {{ election.election_year }}

Overview

Here below are presented all the candidates of the election {{ election.election_name }} -from {{ election.election_year }}, regardless of wether they are valid +from {{ election.election_year }}, regardless of whether they are valid candidates or not.

@@ -97,12 +97,15 @@

Overview

{% if candidate.approved == true%} Candidate approved {% elif candidate.denied == true %} Candidate denied {% else %} Candidate Pending Review {% endif %} diff --git a/nuancier/templates/contributions.html b/nuancier/templates/contributions.html index 254c4b0..322b9e4 100644 --- a/nuancier/templates/contributions.html +++ b/nuancier/templates/contributions.html @@ -62,12 +62,15 @@

Overview

{% if candidate.approved == true %} Candidate approved {% elif candidate.denied == true %} Candidate denied {% else %} Candidate pending review {% endif %} diff --git a/nuancier/templates/elections_list.html b/nuancier/templates/elections_list.html index bf2198d..f3b09ab 100644 --- a/nuancier/templates/elections_list.html +++ b/nuancier/templates/elections_list.html @@ -38,9 +38,11 @@

Elections

{% if election.submission_open %} Submission open {% else %} Submission closed {% endif %} {{ election.submission_date_start }} @@ -48,9 +50,11 @@

Elections

{% if election.election_open %} Election open {% else %} Election open {% endif %} {{ election.election_date_start }} @@ -59,10 +63,12 @@

Elections

{% if election.election_public %} Election published {% else %} Election closed {% endif %} {{ election.election_date_end }} From 3838ea6927c1f2977d24bf9ec433e2f6e1c2489e Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Sat, 5 Oct 2019 17:27:32 +0300 Subject: [PATCH 2/3] Update 7db0e24a2a85_add_submission_end_date.py Change print statement to be compatible with Python 3 --- alembic/versions/7db0e24a2a85_add_submission_end_date.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alembic/versions/7db0e24a2a85_add_submission_end_date.py b/alembic/versions/7db0e24a2a85_add_submission_end_date.py index a188aba..27c2510 100644 --- a/alembic/versions/7db0e24a2a85_add_submission_end_date.py +++ b/alembic/versions/7db0e24a2a85_add_submission_end_date.py @@ -29,7 +29,7 @@ def upgrade(): "submission_date_end=election_date_start;" op.execute(ins) except Exception as err: - print 'ERROR', err + print('ERROR', err) ## Enforce the nullable=False op.alter_column( From 1e838e7cdb6808f755811470eb5a83be54753c4b Mon Sep 17 00:00:00 2001 From: jontrossbach Date: Fri, 5 Jun 2020 13:19:00 -0400 Subject: [PATCH 3/3] update werkzeug library to invoke required workzeug.utils update test requirements remove Python2 from rpm dependencies update travis ci file to use only python 3.7 Use Fedora 32 image instead of Fedora 25 Update Vagrantfile.example --- .travis.yml | 5 +---- README.rst | 2 +- Vagrantfile.example | 8 ++++---- devel/ansible/roles/nuancier-dev/tasks/main.yml | 3 +-- nuancier/__init__.py | 2 +- nuancier/ui.py | 2 +- requirements.txt | 1 + 7 files changed, 10 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 21e57bc..674b998 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,7 @@ sudo: false language: python python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" + - "3.7" install: - pip install tox-travis diff --git a/README.rst b/README.rst index bbd85d5..845e462 100644 --- a/README.rst +++ b/README.rst @@ -37,7 +37,7 @@ order to increase the loading speed of the pages. The dependency list is therefore: -- `python`_ (2.5 minimum) +- `python`_ (3.7 minimum) - `python-flask`_ - `python-flask-wtf`_ - `python-wtforms`_ diff --git a/Vagrantfile.example b/Vagrantfile.example index b924e4b..ad6ad98 100644 --- a/Vagrantfile.example +++ b/Vagrantfile.example @@ -9,11 +9,11 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # If you'd prefer to pull your boxes from Hashicorp's repository, you can # replace the config.vm.box and config.vm.box_url declarations with the line below. # - # config.vm.box = "fedora/30-cloud-base" - config.vm.box = "f30-cloud-libvirt" + # config.vm.box = "fedora/32-cloud-base" + config.vm.box = "f32-cloud-libvirt" config.vm.box_url = "https://download.fedoraproject.org/pub/fedora/linux/releases"\ - "/30/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-30-1"\ - ".2.x86_64.vagrant-libvirt.box" + "/32/Cloud/x86_64/images/Fedora-Cloud-Base-Vagrant-32-1"\ + ".6.x86_64.vagrant-libvirt.box" # Forward traffic on the host to the development server on the guest. # You can change the host port that is forwarded to 5000 on the guest diff --git a/devel/ansible/roles/nuancier-dev/tasks/main.yml b/devel/ansible/roles/nuancier-dev/tasks/main.yml index f750a60..edfd8b1 100644 --- a/devel/ansible/roles/nuancier-dev/tasks/main.yml +++ b/devel/ansible/roles/nuancier-dev/tasks/main.yml @@ -18,10 +18,9 @@ - gcc - libffi-devel - openssl-devel - - python2-devel - python3-devel - redhat-rpm-config - - rpm-python + - python3-rpm # Add various helpful configuration files - name: Install a custom bashrc diff --git a/nuancier/__init__.py b/nuancier/__init__.py index b827a1c..12f9d30 100644 --- a/nuancier/__init__.py +++ b/nuancier/__init__.py @@ -37,7 +37,7 @@ from flask_fas_openid import FAS from six.moves.urllib.parse import urlparse, urljoin from sqlalchemy.exc import SQLAlchemyError -from werkzeug import secure_filename +from werkzeug.utils import secure_filename try: from PIL import Image diff --git a/nuancier/ui.py b/nuancier/ui.py index a4be5ca..a0b1440 100644 --- a/nuancier/ui.py +++ b/nuancier/ui.py @@ -33,7 +33,7 @@ from sqlalchemy.exc import SQLAlchemyError ## pylint cannot import flask dependency correctly # pylint: disable=E0611 -from werkzeug import secure_filename +from werkzeug.utils import secure_filename import nuancier import nuancier.lib as nuancierlib diff --git a/requirements.txt b/requirements.txt index a2d5a0b..b7a4927 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,6 +5,7 @@ blinker # required by flask for tests dogpile.cache flask flask-wtf +flask-oidc Pillow python-fedora >= 0.3.33 python-openid