From f98063835a082238f0c06a8588faa93b82b2e60f Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 8 Nov 2016 01:51:27 -0400 Subject: [PATCH 1/5] Backport resize transformation math operation fix, GitLab issue #319. Thanks to @startmat for the find. --- HISTORY.rst | 4 ++++ mayan/apps/converter/classes.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 7743230c81..98847eaca6 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,3 +1,7 @@ +2.1.5 (2016-xx-xx) +================== +- Backport resize transformation math operation fix (GitLab #319). + 2.1.4 (2016-10-28) ================== - Add missing link to the 2.1.3 release notes in the index file. diff --git a/mayan/apps/converter/classes.py b/mayan/apps/converter/classes.py index 72d3eaf61a..f7b8b22bfe 100644 --- a/mayan/apps/converter/classes.py +++ b/mayan/apps/converter/classes.py @@ -258,7 +258,7 @@ class TransformationResize(BaseTransformation): fit = False width = int(self.width) - height = int(self.height or 1.0 * width * self.aspect) + height = int(self.height or 1.0 * width / self.aspect) factor = 1 while self.image.size[0] / factor > 2 * width and self.image.size[1] * 2 / factor > 2 * height: From 43264f23b1554881b3f12e95050cfc425d8fd73e Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 8 Nov 2016 01:58:48 -0400 Subject: [PATCH 2/5] Update Pillow to version 3.1.2 --- HISTORY.rst | 1 + docs/releases/2.1.5.rst | 75 +++++++++++++++++++++++++++++++++++++++++ docs/releases/index.rst | 1 + requirements/base.txt | 2 +- setup.py | 2 +- 5 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 docs/releases/2.1.5.rst diff --git a/HISTORY.rst b/HISTORY.rst index 98847eaca6..4fa0ba0b7a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,6 +1,7 @@ 2.1.5 (2016-xx-xx) ================== - Backport resize transformation math operation fix (GitLab #319). +- Update Pillow to 3.1.2 (Security fix). 2.1.4 (2016-10-28) ================== diff --git a/docs/releases/2.1.5.rst b/docs/releases/2.1.5.rst new file mode 100644 index 0000000000..a8448d1365 --- /dev/null +++ b/docs/releases/2.1.5.rst @@ -0,0 +1,75 @@ +=============================== +Mayan EDMS v2.1.5 release notes +=============================== + +Released: XX, 2016 + +What's new +========== + +This is a bug-fix release and all users are encouraged to upgrade. + +Other changes +------------- + +- Update Pillow to 3.1.2 + + - https://pillow.readthedocs.io/en/3.4.x/releasenotes/3.1.1.html + - https://pillow.readthedocs.io/en/3.4.x/releasenotes/3.1.2.html + +Removals +-------- +* None + +Upgrading from a previous version +--------------------------------- + +Using PIP +~~~~~~~~~ + +Type in the console:: + + $ pip install -U mayan-edms + +the requirements will also be updated automatically. + +Using Git +~~~~~~~~~ + +If you installed Mayan EDMS by cloning the Git repository issue the commands:: + + $ git reset --hard HEAD + $ git pull + +otherwise download the compressed archived and uncompress it overriding the +existing installation. + +Next upgrade/add the new requirements:: + + $ pip install --upgrade -r requirements.txt + +Common steps +~~~~~~~~~~~~ + +Migrate existing database schema with:: + + $ mayan-edms.py performupgrade + +Add new static media:: + + $ mayan-edms.py collectstatic --noinput + +The upgrade procedure is now complete. + + +Backward incompatible changes +============================= + +* None + +Bugs fixed or issues closed +=========================== + +* `GitLab issue #311 `_ acl page return ContentType:Document + +.. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/docs/releases/index.rst b/docs/releases/index.rst index eb7c8bee1e..7e0b85a652 100644 --- a/docs/releases/index.rst +++ b/docs/releases/index.rst @@ -22,6 +22,7 @@ versions of the documentation contain the release notes for any later releases. .. toctree:: :maxdepth: 1 + 2.1.5 2.1.4 2.1.3 2.1.2 diff --git a/requirements/base.txt b/requirements/base.txt index 529260ad08..c87051054e 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -1,4 +1,4 @@ -Pillow==3.1.0 +Pillow==3.1.2 PyYAML==3.11 celery==3.1.19 diff --git a/setup.py b/setup.py index 9a7462d238..b2396e91eb 100644 --- a/setup.py +++ b/setup.py @@ -57,7 +57,7 @@ def find_packages(directory): install_requires = """ Django==1.8.15 -Pillow==3.1.0 +Pillow==3.1.2 PyYAML==3.11 celery==3.1.19 cssmin==0.2.0 From 4222035cc1ec70df04154a64e3b85a01e7051da7 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 8 Nov 2016 02:03:10 -0400 Subject: [PATCH 3/5] Backport zoom transformation performance improvement, GitLab issue #334. Thanks to @startmat for the patch. --- HISTORY.rst | 2 ++ docs/releases/2.1.5.rst | 7 ++++++- mayan/apps/converter/classes.py | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 4fa0ba0b7a..e3cfdcedb3 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,8 @@ ================== - Backport resize transformation math operation fix (GitLab #319). - Update Pillow to 3.1.2 (Security fix). +- Backport zoom transformation performance improvement (GitLab #334). + 2.1.4 (2016-10-28) ================== diff --git a/docs/releases/2.1.5.rst b/docs/releases/2.1.5.rst index a8448d1365..015bc9a9b9 100644 --- a/docs/releases/2.1.5.rst +++ b/docs/releases/2.1.5.rst @@ -12,11 +12,15 @@ This is a bug-fix release and all users are encouraged to upgrade. Other changes ------------- +- Backport resize transformation math operation fix (GitLab #319). - Update Pillow to 3.1.2 - https://pillow.readthedocs.io/en/3.4.x/releasenotes/3.1.1.html - https://pillow.readthedocs.io/en/3.4.x/releasenotes/3.1.2.html +- Backport zoom performance improvement (GitLab #334). + + Removals -------- * None @@ -70,6 +74,7 @@ Backward incompatible changes Bugs fixed or issues closed =========================== -* `GitLab issue #311 `_ acl page return ContentType:Document +* `GitLab issue #319 `_ TransformationResize issue with very "long" image +* `GitLab issue #334 `_ Perfomance improvment: prevent unnecessary image.resize in TransformationZoom .. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/mayan/apps/converter/classes.py b/mayan/apps/converter/classes.py index f7b8b22bfe..74388e13d0 100644 --- a/mayan/apps/converter/classes.py +++ b/mayan/apps/converter/classes.py @@ -309,6 +309,9 @@ class TransformationZoom(BaseTransformation): def execute_on(self, *args, **kwargs): super(TransformationZoom, self).execute_on(*args, **kwargs) + if self.percent == 100: + return self.image + decimal_value = float(self.percent) / 100 return self.image.resize( ( From 14bde36c1ffd6dbea4d5d9edb7acfcf2967a730f Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 8 Nov 2016 02:13:18 -0400 Subject: [PATCH 4/5] Backport trash can navigation link resolution fix, GitLab issue #331. Thanks to @DocCyblade for the report. --- HISTORY.rst | 2 +- docs/releases/2.1.5.rst | 2 ++ mayan/apps/navigation/classes.py | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index e3cfdcedb3..e6785dd476 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,7 +3,7 @@ - Backport resize transformation math operation fix (GitLab #319). - Update Pillow to 3.1.2 (Security fix). - Backport zoom transformation performance improvement (GitLab #334). - +- Backport trash can navigation link resolution fix (GitLab #331). 2.1.4 (2016-10-28) ================== diff --git a/docs/releases/2.1.5.rst b/docs/releases/2.1.5.rst index 015bc9a9b9..474d7f76b6 100644 --- a/docs/releases/2.1.5.rst +++ b/docs/releases/2.1.5.rst @@ -19,6 +19,7 @@ Other changes - https://pillow.readthedocs.io/en/3.4.x/releasenotes/3.1.2.html - Backport zoom performance improvement (GitLab #334). +- Backport trash can navigation link resolution fix (GitLab #331). Removals @@ -75,6 +76,7 @@ Bugs fixed or issues closed =========================== * `GitLab issue #319 `_ TransformationResize issue with very "long" image +* `GitLab issue #331 `_ Trash List View: Items actions should be limited * `GitLab issue #334 `_ Perfomance improvment: prevent unnecessary image.resize in TransformationZoom .. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/mayan/apps/navigation/classes.py b/mayan/apps/navigation/classes.py index 2d45129369..492c6de810 100644 --- a/mayan/apps/navigation/classes.py +++ b/mayan/apps/navigation/classes.py @@ -126,19 +126,19 @@ class Menu(object): for bound_source, links in self.bound_links.iteritems(): try: - if inspect.isclass(bound_source) and type(resolved_navigation_object) == bound_source: - for link in links: - resolved_link = link.resolve( - context=context, - resolved_object=resolved_navigation_object - ) - if resolved_link: - resolved_links.append(resolved_link) - # No need for further content object match testing - break - else: + if inspect.isclass(bound_source): + if type(resolved_navigation_object) == bound_source: + for link in links: + resolved_link = link.resolve( + context=context, + resolved_object=resolved_navigation_object + ) + if resolved_link: + resolved_links.append(resolved_link) + # No need for further content object match testing + break + elif hasattr(resolved_navigation_object, 'get_deferred_fields') and resolved_navigation_object.get_deferred_fields() and isinstance(resolved_navigation_object, bound_source): # Second try for objects using .defer() or .only() - if inspect.isclass(bound_source) and isinstance(resolved_navigation_object, bound_source): for link in links: resolved_link = link.resolve( context=context, From 6b9b280d7121fad155e26de4c5af0d193864500b Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 8 Nov 2016 02:26:17 -0400 Subject: [PATCH 5/5] Improve documentation regarding the use of GPG version 1. GitLab issue #333. Thank to @Albe for the report. --- HISTORY.rst | 1 + docs/index.rst | 4 +++- docs/releases/2.1.5.rst | 3 ++- docs/topics/deploying.rst | 9 ++++++++- mayan/settings/testing/base.py | 2 -- mayan/settings/testing/gitlab-ci/__init__.py | 3 +++ 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index e6785dd476..540ac20a12 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,7 @@ - Update Pillow to 3.1.2 (Security fix). - Backport zoom transformation performance improvement (GitLab #334). - Backport trash can navigation link resolution fix (GitLab #331). +- Improve documentation regarding the use of GPG version 1 (GitLab #333). 2.1.4 (2016-10-28) ================== diff --git a/docs/index.rst b/docs/index.rst index 5414dd9a4b..3038bca246 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,7 +10,9 @@ and install it from PyPI with the following commands: .. code-block:: bash - $ sudo apt-get install libjpeg-dev libmagic1 libpng-dev libreoffice libtiff-dev gcc ghostscript gnupg1 python-dev python-virtualenv tesseract-ocr poppler-utils -y + $ sudo apt-get install libjpeg-dev libmagic1 libpng-dev \ + libreoffice libtiff-dev gcc ghostscript gnupg python-dev \ + python-virtualenv tesseract-ocr poppler-utils -y $ virtualenv venv $ source venv/bin/activate (venv) pip install mayan-edms diff --git a/docs/releases/2.1.5.rst b/docs/releases/2.1.5.rst index 474d7f76b6..4a75e8fd18 100644 --- a/docs/releases/2.1.5.rst +++ b/docs/releases/2.1.5.rst @@ -20,7 +20,7 @@ Other changes - Backport zoom performance improvement (GitLab #334). - Backport trash can navigation link resolution fix (GitLab #331). - +- Improve documentation regarding the use of GPG version 1 (GitLab #333). Removals -------- @@ -77,6 +77,7 @@ Bugs fixed or issues closed * `GitLab issue #319 `_ TransformationResize issue with very "long" image * `GitLab issue #331 `_ Trash List View: Items actions should be limited +* `GitLab issue #333 `_ "Unable to run gpg - it may not be available." * `GitLab issue #334 `_ Perfomance improvment: prevent unnecessary image.resize in TransformationZoom .. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/docs/topics/deploying.rst b/docs/topics/deploying.rst index 4893a9bd20..227998700e 100644 --- a/docs/topics/deploying.rst +++ b/docs/topics/deploying.rst @@ -22,9 +22,13 @@ Install all system dependencies:: apt-get install nginx supervisor redis-server postgresql \ libpq-dev libjpeg-dev libmagic1 libpng-dev libreoffice \ - libtiff-dev gcc ghostscript gnupg1 python-dev python-virtualenv \ + libtiff-dev gcc ghostscript gnupg python-dev python-virtualenv \ tesseract-ocr poppler-utils -y +If using Ubuntu 16.10 also install GPG version 1 (as GPG version 2 is the new default for this distribution and not yet supported by Mayan EDMS) :: + + apt-get install gnupg1 -y + Change to the directory where the project will be deployed:: cd /usr/share @@ -81,6 +85,9 @@ Append the following to the ``mayan/settings/local.py`` file, paying attention t BROKER_URL = 'redis://127.0.0.1:6379/0' CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/0' + +If using Ubuntu 16.10, also add this line to the ``mayan/settings/local.py`` file:: + SIGNATURES_GPG_PATH = '/usr/bin/gpg1' Migrate the database or initialize the project:: diff --git a/mayan/settings/testing/base.py b/mayan/settings/testing/base.py index ab85238029..20e0329014 100644 --- a/mayan/settings/testing/base.py +++ b/mayan/settings/testing/base.py @@ -2,8 +2,6 @@ from __future__ import absolute_import, unicode_literals from ..base import * # NOQA -SIGNATURES_GPG_PATH = '/usr/bin/gpg1' - INSTALLED_APPS += ('test_without_migrations',) TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', diff --git a/mayan/settings/testing/gitlab-ci/__init__.py b/mayan/settings/testing/gitlab-ci/__init__.py index 5064039dd7..52dd3067e9 100644 --- a/mayan/settings/testing/gitlab-ci/__init__.py +++ b/mayan/settings/testing/gitlab-ci/__init__.py @@ -1 +1,4 @@ from ..base import * # NOQA + +SIGNATURES_GPG_PATH = '/usr/bin/gpg1' +