From b6a4097ebf93a9f8f3edc1a7ac9a6c30a930d236 Mon Sep 17 00:00:00 2001 From: valentinab25 <30239069+valentinab25@users.noreply.github.com> Date: Thu, 13 Feb 2020 13:27:39 +0200 Subject: [PATCH 1/5] Prepare for gitflow automatic release Refs #110159 --- Jenkinsfile | 4 ++-- MANIFEST.in | 11 +++++++---- eea/userseditor/version.txt | 1 + setup.py | 12 +++++++++--- 4 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 eea/userseditor/version.txt diff --git a/Jenkinsfile b/Jenkinsfile index c98f20e..26ca40f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -130,7 +130,7 @@ pipeline { } } -/* stage('Pull Request') { + stage('Pull Request') { when { not { environment name: 'CHANGE_ID', value: '' @@ -165,7 +165,7 @@ pipeline { } } } - }*/ + } } diff --git a/MANIFEST.in b/MANIFEST.in index 0072f8d..8a7e39e 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,7 @@ -include *.rst -recursive-include eea * -global-exclude *py[co] - +include *.md *.rst *.txt +graft docs +graft eea +global-exclude *pyc +global-exclude *~ +global-exclude *.un~ +global-include *.mo diff --git a/eea/userseditor/version.txt b/eea/userseditor/version.txt new file mode 100644 index 0000000..cd5ac03 --- /dev/null +++ b/eea/userseditor/version.txt @@ -0,0 +1 @@ +2.0 diff --git a/setup.py b/setup.py index e28d00a..d8688c8 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,18 @@ +import os from setuptools import setup, find_packages -setup(name='eea.userseditor', - version='1.1.39', +NAME = "eea.userseditor" +PATH = NAME.split('.') + ['version.txt'] +VERSION = open(os.path.join(*PATH)).read().strip() + +setup(name=NAME, + version=VERSION, author='Eau de Web', author_email='office@eaudeweb.ro', packages=find_packages(), include_package_data=True, platforms=['OS Independent'], zip_safe=False, - install_requires=['eea.usersdb>=1.3.40', 'deform', 'phonenumbers', 'six'], + install_requires=['eea.usersdb>=1.3.40', 'deform', 'phonenumbers', + 'six'], ) From f460875f0ee47892053a9fcfe85456603c4f6798 Mon Sep 17 00:00:00 2001 From: valentinab25 <30239069+valentinab25@users.noreply.github.com> Date: Thu, 13 Feb 2020 13:29:23 +0200 Subject: [PATCH 2/5] Add fields for setup.py release on pypi --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index d8688c8..45e7c9e 100644 --- a/setup.py +++ b/setup.py @@ -7,6 +7,12 @@ setup(name=NAME, version=VERSION, + description="EEA Users Editor", + long_description_content_type="text/x-rst", + long_description=( + open("README.rst").read() + "\n" + + open("CHANGELOG.rst").read() + ), author='Eau de Web', author_email='office@eaudeweb.ro', packages=find_packages(), From a600844ee4479fb81933b5802bab13f3450694ac Mon Sep 17 00:00:00 2001 From: valentinab25 <30239069+valentinab25@users.noreply.github.com> Date: Thu, 13 Feb 2020 13:30:27 +0200 Subject: [PATCH 3/5] Add GIT_HISTORYFILE location --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 26ca40f..f433d15 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -144,7 +144,7 @@ pipeline { error "Pipeline aborted due to PR not made from develop or hotfix branch" } withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN')]) { - sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-pr" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" eeacms/gitflow''' + sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-pr" -e GIT_CHANGE_BRANCH="$CHANGE_BRANCH" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e GIT_HISTORYFILE=CHANGELOG.rst eeacms/gitflow''' } } } @@ -161,7 +161,7 @@ pipeline { steps { node(label: 'docker') { withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'eea-jenkins', usernameVariable: 'EGGREPO_USERNAME', passwordVariable: 'EGGREPO_PASSWORD'],string(credentialsId: 'eea-jenkins-token', variable: 'GITHUB_TOKEN'),[$class: 'UsernamePasswordMultiBinding', credentialsId: 'pypi-jenkins', usernameVariable: 'PYPI_USERNAME', passwordVariable: 'PYPI_PASSWORD']]) { - sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e EGGREPO_USERNAME="$EGGREPO_USERNAME" -e EGGREPO_PASSWORD="$EGGREPO_PASSWORD" -e GIT_NAME="$GIT_NAME" -e PYPI_USERNAME="$PYPI_USERNAME" -e PYPI_PASSWORD="$PYPI_PASSWORD" -e GIT_ORG="$GIT_ORG" -e GIT_TOKEN="$GITHUB_TOKEN" eeacms/gitflow''' + sh '''docker run -i --rm --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e EGGREPO_USERNAME="$EGGREPO_USERNAME" -e EGGREPO_PASSWORD="$EGGREPO_PASSWORD" -e GIT_NAME="$GIT_NAME" -e PYPI_USERNAME="$PYPI_USERNAME" -e PYPI_PASSWORD="$PYPI_PASSWORD" -e GIT_ORG="$GIT_ORG" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_HISTORYFILE=CHANGELOG.rst eeacms/gitflow''' } } } From 2fef4773f3e8c44a4b3feffd73505aa2c49ea0c0 Mon Sep 17 00:00:00 2001 From: Valentin Dumitru Date: Thu, 13 Feb 2020 16:35:12 +0200 Subject: [PATCH 4/5] bugfix for user details with role with no description updated Changelog --- CHANGELOG.rst | 5 ++++- eea/userseditor/userdetails.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bdef983..f5b68c1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,4 +1,7 @@ -1.1.39 (unreleased) +Changelog +========= + +2.0 (2020-02-13) ------------------ * fix fetching of error message [dumitval] * remove unused import [dumitval] diff --git a/eea/userseditor/userdetails.py b/eea/userseditor/userdetails.py index 1fcf9b3..c1c3d20 100644 --- a/eea/userseditor/userdetails.py +++ b/eea/userseditor/userdetails.py @@ -101,7 +101,7 @@ def wrap(self, body_html): try: layout = self.aq_parent.getLayoutTool().getCurrentSkin() main_template = layout.getTemplateById('standard_template') - except: + except Exception: main_template = self.aq_parent.restrictedTraverse( 'standard_template.pt') main_page_macro = main_template.macros['page'] @@ -238,7 +238,7 @@ def _prepare_user_page(self, uid): for (role_id, attrs) in ldap_roles: roles.append((role_id, - attrs.get('description', ('', ))[0].decode('utf8'))) + attrs.get('description', (b'', ))[0].decode('utf8'))) user = agent.user_info(uid) user['jpegPhoto'] = agent.get_profile_picture(uid) user['certificate'] = agent.get_certificate(uid) From ef2902ea41ef0de038e42846ff9071923fd8fa90 Mon Sep 17 00:00:00 2001 From: Valentin Dumitru Date: Thu, 13 Feb 2020 18:25:50 +0200 Subject: [PATCH 5/5] Changelog formattinf fixes --- CHANGELOG.rst | 68 +++++++++++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f5b68c1..0de09de 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,7 +2,7 @@ Changelog ========= 2.0 (2020-02-13) ------------------- +-------------------- * fix fetching of error message [dumitval] * remove unused import [dumitval] * Fix decode error on user details page [dumitval] @@ -21,166 +21,166 @@ Changelog (no longer using authenticated user's credentials) [dumitval] 1.1.38 (2019-03-05) ------------------- +-------------------- * add and use bind credentials for unrestricted search [dumitval] 1.1.37 (2018-06-12) ------------------- +-------------------- * avoid crash if uid is not sent to the user details page [dumitval] 1.1.36 (2018-04-27) ------------------- +-------------------- * add secondary ldap bind auth for unlimited search [dumitval] 1.1.35 (2018-03-14) ------------------- +-------------------- * raise NotFound for disabled users (user directory) [dumitval] 1.1.34 (2018-02-12) ------------------- +-------------------- * show the date of the last password change in user details page refs #92555 [dumitval] 1.1.33 (2018-02-09) ------------------- +-------------------- * clearly mark an invalid organisation setting on user details [dumitval] 1.1.32 (2017-06-19) ------------------- +-------------------- * password reset supports stricter password policy in ldap [dumitval] 1.1.31 (2016-11-22) ------------------- +-------------------- * add os environ to zope environment [dumitval] 1.1.30 (2016-11-21) ------------------- +-------------------- * bugfix for users changing Organisation [dumitval] 1.1.29 (2016-10-10) ------------------- +-------------------- * show roles at the time a user was disabled [dumitval] 1.1.28 (2016-10-03) ------------------- +-------------------- * add organisation title in national language to the organisation selection list [dumitval] * add Organisation title (if valid link available) and Department to the user details page [dumitval] 1.1.27 (2015-11-24) ------------------- +-------------------- * fix crash in user details when organisation from user's history was deleted [dumitval] 1.1.26 (2015-06-08) ------------------- +-------------------- * Bug fix: fixed user profile editor for missing organisation field [tiberich #26247] 1.1.25 (2015-05-19) ------------------- +-------------------- * Bug fix: call agent._get_metadata with userdn, not user id [tiberich] 1.1.24 (2015-04-14) ------------------- +-------------------- * is_manager replaced by can_edit_users, bound to permission, not role [dumitval] 1.1.23 (2015-03-30) ------------------- +-------------------- * Change: use bind=True in operations to allow retrieving the email address [tiberich #24362] 1.1.22 (2015-01-15) ------------------- +-------------------- * Bug fix: lineup arrows indicators in changelog with the rest of the text [tiberich #20422] * Bug fix: don't show a user as disabled if he's not really disabled [tiberich #22487] 1.1.21 (2014-10-10) ------------------- +-------------------- * Bug fix: removed the visual icon ids, replaced them with some simple arrows [tiberich #20422] 1.1.20 (2014-09-24) ------------------- +-------------------- * Feature: added RESET_ACCOUNT view for the changelog [tiberich #9164] 1.1.19 (2014-09-19) ------------------- +-------------------- * Added method to retrieve user organisation membership [tiberich #20832] 1.1.18 (2014-07-15) ------------------- +-------------------- * Bug fix: fix case when editing user profile and an Organisation Editor was not found [tiberich #19143] 1.1.17 (2014-07-03) ------------------- +-------------------- * Bug fix: remove all organisations for a user before changing his organisation [tiberich #19143] 1.1.16 (2014-07-02) ------------------- +-------------------- * Bug fix: use the organisation membership for a member when showing his organisation in the edit form, instead of the 'o' field [tiberich #19143] 1.1.15 (2014-07-02) ------------------- +-------------------- * Bug fix: use the groupware standard_template when Zope is a Naaya groupware application [tiberich #19143] 1.1.14 (2014-07-01) ------------------- +-------------------- * Bug fix: don't fail when removing user from org if user is not in org [tiberich #19143] 1.1.13 (2014-07-01) ------------------- +-------------------- * Bug fix: use alternate agent to avoid insufficient permissions to perform LDAP operations [tiberich #19143] 1.1.12 (2014-07-01) ------------------- +-------------------- * Bug fix: remove user from old org when changing his organisation [tiberich #19143] 1.1.11 (2014-06-30) ------------------- +-------------------- * Feature: allow users to select their organisation from a list [tiberich #19143] 1.1.10 (2014-06-16) ------------------- +-------------------- * Bug fix: use the proper author name based on logged in user in changelog for user operations [tiberich #20081] 1.1.9 (2014-06-16) ------------------- +-------------------- * Bug fix: display the proper organisation name in changelog [tiberich #20081] 1.1.8 (2014-06-16) ------------------- +-------------------- * Bug fix: added views for the ADD_PENDING_TO_ORG changelog action [tiberich #20081] 1.1.7 (2014-06-10) ------------------- +-------------------- * Bugfix related to the encoding of role descriptions [dumitval] 1.1.6 (2014-05-12) ------------------- +-------------------- * Bug fix: don't take into consideration "owner of role" when displaying history of roles [tiberich #19565]