diff --git a/HISTORY.rst b/HISTORY.rst index 236d999676..c0788306ce 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,13 +7,15 @@ - Fix height calculation in resize transformation - Improve upgrade instructions -2.1.5 (2016-xx-xx) +2.1.5 (2016-11-08) ================== - 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). - Improve documentation regarding the use of GPG version 1 (GitLab #333). +- Fix ACL create view HTML response type. (GitLab #335). +- Expland staging folder and watch folder explanation. 2.1.4 (2016-10-28) ================== diff --git a/Makefile b/Makefile index b1db15d2af..9395e8d8f6 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,5 @@ .PHONY: clean-pyc clean-build -define BROWSER_PYSCRIPT -import sys, webbrowser -webbrowser.open(sys.argv[1]) -endef -export BROWSER_PYSCRIPT -BROWSER := python -c "$$BROWSER_PYSCRIPT" - help: @echo @@ -65,7 +58,6 @@ test-all: # Documentation docs_serve: - $(BROWSER) http://127.0.0.1:8000 cd docs;make livehtml @@ -113,7 +105,6 @@ wheel: clean # Dev server runserver: - $(BROWSER) http://127.0.0.1:8000 ./manage.py runserver runserver_plus: diff --git a/docs/releases/2.1.5.rst b/docs/releases/2.1.5.rst index 4a75e8fd18..023397cec6 100644 --- a/docs/releases/2.1.5.rst +++ b/docs/releases/2.1.5.rst @@ -2,7 +2,7 @@ Mayan EDMS v2.1.5 release notes =============================== -Released: XX, 2016 +Released: November 8, 2016 What's new ========== @@ -21,6 +21,8 @@ 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). +- Fix ACL create view HTML response type. (GitLab #335). +- Expland staging folder and watch folder explanation. Removals -------- @@ -79,5 +81,7 @@ Bugs fixed or issues closed * `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 +* `GitLab issue #335 `_ Wrong HTML Content-Type in ACL->NEW + .. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/docs/topics/sources.rst b/docs/topics/sources.rst index 597a5d8a6a..b4e720d366 100644 --- a/docs/topics/sources.rst +++ b/docs/topics/sources.rst @@ -9,9 +9,6 @@ The current document sources supported are: - Web - ``HTML`` forms with a ``Browse`` button that will open the file dialog when clicked to allow selection of files in the user's computer to be uploaded as documents. -- Staging folder - Folder where networked attached scanned can save image - files. The files in these staging folders are scanned and a preview is - generated to help the process of upload. - POP3 email - Provide the email, server and credential of a ``POP3`` based email to be scanned periodically for email. The body of the email is uploaded as a document and the attachments of the email are uploaded as separate @@ -20,6 +17,19 @@ The current document sources supported are: the ``IMAP`` protocol. - Watch folder - A filesystem folder that is scanned periodically for files. Any file in the watch folder is automatically uploaded. +- Staging folder - Folder where networked attached scanned can save image + files. The files in these staging folders are scanned and a preview is + generated to help the process of upload. Staging folders and Watch folders + work in a similar way with the main difference being that Staging folders are + interactive while Watch folders are automatic; documents in a Watch folder + are uploaded periodically and documents in a Staging folder remain indefinitely + there until an user uploads them. A preview for files in a Staging folder is + also provided. An example of Staging folder use is when multiple people + are scanning documents but only one person must be allowed to upload those + documents. This one person examines the scans quality and decides what to + upload and what to reject and have re-scanned. Watch folders can be used + when the quality of the scans is irrelevant or when they will be known + to be of good quality, such as when receiving e-faxes as PDFs. Document source can be configure to allow document bundles to uploaded as compressed files which are decompressed and their content uploaded as separate diff --git a/mayan/__init__.py b/mayan/__init__.py index 188ec8ef38..cd921cfcd8 100644 --- a/mayan/__init__.py +++ b/mayan/__init__.py @@ -1,8 +1,8 @@ from __future__ import unicode_literals __title__ = 'Mayan EDMS' -__version__ = '2.1.4' -__build__ = 0x020103 +__version__ = '2.1.5' +__build__ = 0x020105 __author__ = 'Roberto Rosario' __author_email__ = 'roberto.rosario@mayan-edms.com' __description__ = 'Free Open Source Electronic Document Management System' diff --git a/mayan/apps/acls/tests/test_views.py b/mayan/apps/acls/tests/test_views.py index 58dfb936b4..556c0f3738 100644 --- a/mayan/apps/acls/tests/test_views.py +++ b/mayan/apps/acls/tests/test_views.py @@ -26,7 +26,7 @@ class AccessControlListViewTestCase(GenericDocumentViewTestCase): def test_acl_create_view_no_permission(self): self.login(username=TEST_USER_USERNAME, password=TEST_USER_PASSWORD) - response = self.post( + response = self.get( viewname='acls:acl_create', kwargs=self.view_arguments, data={ 'role': self.role.pk } @@ -42,6 +42,35 @@ class AccessControlListViewTestCase(GenericDocumentViewTestCase): permission_acl_edit.stored_permission ) + response = self.get( + viewname='acls:acl_create', kwargs=self.view_arguments, data={ + 'role': self.role.pk + }, follow=True + ) + + self.assertContains( + response, text=self.document.label, status_code=200 + ) + + def test_acl_create_view_post_no_permission(self): + self.login(username=TEST_USER_USERNAME, password=TEST_USER_PASSWORD) + + response = self.post( + viewname='acls:acl_create', kwargs=self.view_arguments, data={ + 'role': self.role.pk + } + ) + + self.assertEquals(response.status_code, 403) + self.assertEqual(AccessControlList.objects.count(), 0) + + def test_acl_create_view_with_post_permission(self): + self.login(username=TEST_USER_USERNAME, password=TEST_USER_PASSWORD) + + self.role.permissions.add( + permission_acl_edit.stored_permission + ) + response = self.post( viewname='acls:acl_create', kwargs=self.view_arguments, data={ 'role': self.role.pk diff --git a/mayan/apps/acls/views.py b/mayan/apps/acls/views.py index aae5ae888c..cce6cbefba 100644 --- a/mayan/apps/acls/views.py +++ b/mayan/apps/acls/views.py @@ -28,16 +28,16 @@ class ACLCreateView(SingleObjectCreateView): model = AccessControlList def dispatch(self, request, *args, **kwargs): - self.content_type = get_object_or_404( + self.object_content_type = get_object_or_404( ContentType, app_label=self.kwargs['app_label'], model=self.kwargs['model'] ) try: - self.content_object = self.content_type.get_object_for_this_type( + self.content_object = self.object_content_type.get_object_for_this_type( pk=self.kwargs['object_id'] ) - except self.content_type.model_class().DoesNotExist: + except self.object_content_type.model_class().DoesNotExist: raise Http404 AccessControlList.objects.check_access( @@ -55,7 +55,7 @@ class ACLCreateView(SingleObjectCreateView): def form_valid(self, form): try: acl = AccessControlList.objects.get( - content_type=self.content_type, + content_type=self.object_content_type, object_id=self.content_object.pk, role=form.cleaned_data['role'] ) @@ -121,7 +121,7 @@ class ACLListView(SingleObjectListView): self.content_object = self.object_content_type.get_object_for_this_type( pk=self.kwargs['object_id'] ) - except self.content_type.model_class().DoesNotExist: + except self.object_content_type.model_class().DoesNotExist: raise Http404 AccessControlList.objects.check_access( diff --git a/mayan/apps/converter/classes.py b/mayan/apps/converter/classes.py index 7c80859ef0..1183a90327 100644 --- a/mayan/apps/converter/classes.py +++ b/mayan/apps/converter/classes.py @@ -311,6 +311,12 @@ class TransformationRotate(BaseTransformation): def execute_on(self, *args, **kwargs): super(TransformationRotate, self).execute_on(*args, **kwargs) + + self.degrees %= 360 + + if self.degress == 0: + return self.image + return self.image.rotate( 360 - self.degrees, resample=Image.BICUBIC, expand=True ) diff --git a/mayan/settings/testing/gitlab-ci/__init__.py b/mayan/settings/testing/gitlab-ci/__init__.py index 52dd3067e9..46fb87a6c1 100644 --- a/mayan/settings/testing/gitlab-ci/__init__.py +++ b/mayan/settings/testing/gitlab-ci/__init__.py @@ -1,4 +1,4 @@ -from ..base import * # NOQA +from .base import * # NOQA SIGNATURES_GPG_PATH = '/usr/bin/gpg1' diff --git a/mayan/settings/testing/gitlab-ci/base.py b/mayan/settings/testing/gitlab-ci/base.py new file mode 100644 index 0000000000..eb890b44b0 --- /dev/null +++ b/mayan/settings/testing/gitlab-ci/base.py @@ -0,0 +1,5 @@ +from __future__ import unicode_literals + +from ..base import * # NOQA + +SIGNATURES_GPG_PATH = '/usr/bin/gpg1' diff --git a/mayan/settings/testing/gitlab-ci/db_mysql.py b/mayan/settings/testing/gitlab-ci/db_mysql.py index 00a9050121..6792c95e34 100644 --- a/mayan/settings/testing/gitlab-ci/db_mysql.py +++ b/mayan/settings/testing/gitlab-ci/db_mysql.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from ..base import * # NOQA +from .base import * # NOQA DATABASES = { 'default': { diff --git a/mayan/settings/testing/gitlab-ci/db_postgres.py b/mayan/settings/testing/gitlab-ci/db_postgres.py index bf0ff1d380..fb763595d9 100644 --- a/mayan/settings/testing/gitlab-ci/db_postgres.py +++ b/mayan/settings/testing/gitlab-ci/db_postgres.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals -from ..base import * # NOQA +from .base import * # NOQA DATABASES = { 'default': {