diff --git a/HISTORY.rst b/HISTORY.rst index 38802a82cf..7a43061f5b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,3 +1,7 @@ +3.1.11 (2019-04-XX) +=================== +* Fix multiple tag selection wizard step. + 3.1.10 (2019-04-04) =================== * Backport test case improvements from the development branch. Add random diff --git a/docs/releases/3.1.11.rst b/docs/releases/3.1.11.rst new file mode 100644 index 0000000000..e7d593f49d --- /dev/null +++ b/docs/releases/3.1.11.rst @@ -0,0 +1,85 @@ +Version 3.1.11 +============== + +Released: April XX, 2019 + + +Changes +------- + +Other changes +^^^^^^^^^^^^^ + +* Fix multiple tag selection wizard step. + +Removals +-------- + +* None + + +Upgrading from a previous version +--------------------------------- + +If installed via Python's PIP +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Remove deprecated requirements:: + + $ curl https://gitlab.com/mayan-edms/mayan-edms/raw/master/removals.txt | pip uninstall -r /dev/stdin + +Type in the console:: + + $ pip install mayan-edms==3.1.11 + +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. + +Remove deprecated requirements:: + + $ pip uninstall -y -r removals.txt + +Next upgrade/add the new requirements:: + + $ pip install --upgrade -r requirements.txt + + +Common steps +^^^^^^^^^^^^ + +Perform these steps after updating the code from either step above. + +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:`563` Recursive Watch Folder + +.. _PyPI: https://pypi.python.org/pypi/mayan-edms/ diff --git a/docs/releases/index.rst b/docs/releases/index.rst index d3b2470bfa..922a5647fa 100644 --- a/docs/releases/index.rst +++ b/docs/releases/index.rst @@ -20,6 +20,7 @@ versions of the documentation contain the release notes for any later releases. .. toctree:: :maxdepth: 1 + 3.1.11 3.1.10 3.1.9 3.1.8 diff --git a/mayan/apps/tags/tests/literals.py b/mayan/apps/tags/tests/literals.py index a1f714ab91..c1206eb2f1 100644 --- a/mayan/apps/tags/tests/literals.py +++ b/mayan/apps/tags/tests/literals.py @@ -5,6 +5,8 @@ TEST_TAG_LABEL_EDITED = 'test-tag-edited' TEST_TAG_COLOR = '#001122' TEST_TAG_COLOR_EDITED = '#221100' +TEST_TAG_LABEL_2 = 'test-tag-2' + TEST_TAG_INDEX_HAS_TAG = 'HAS_TAG' TEST_TAG_INDEX_NO_TAG = 'NO_TAG' TEST_TAG_INDEX_NODE_TEMPLATE = ''' diff --git a/mayan/apps/tags/tests/test_wizard_steps.py b/mayan/apps/tags/tests/test_wizard_steps.py index 273381465c..3539d63c60 100644 --- a/mayan/apps/tags/tests/test_wizard_steps.py +++ b/mayan/apps/tags/tests/test_wizard_steps.py @@ -12,10 +12,12 @@ from sources.tests.literals import ( from ..models import Tag -from .literals import TEST_TAG_COLOR, TEST_TAG_LABEL +from .literals import TEST_TAG_COLOR, TEST_TAG_LABEL, TEST_TAG_LABEL_2 class TaggedDocumentUploadTestCase(GenericDocumentViewTestCase): + auto_upload_document = False + def setUp(self): super(TaggedDocumentUploadTestCase, self).setUp() self.login_user() @@ -24,8 +26,6 @@ class TaggedDocumentUploadTestCase(GenericDocumentViewTestCase): uncompress=TEST_SOURCE_UNCOMPRESS_N ) - self.document.delete() - def _request_upload_interactive_document_create_view(self): with open(TEST_SMALL_DOCUMENT_PATH, mode='rb') as file_object: return self.post( @@ -33,7 +33,7 @@ class TaggedDocumentUploadTestCase(GenericDocumentViewTestCase): data={ 'document_type_id': self.document_type.pk, 'source-file': file_object, - 'tags': self.tag.pk + 'tags': ','.join(map(str, Tag.objects.values_list('pk', flat=True))) } ) @@ -42,11 +42,31 @@ class TaggedDocumentUploadTestCase(GenericDocumentViewTestCase): color=TEST_TAG_COLOR, label=TEST_TAG_LABEL ) + def _create_tag_2(self): + self.tag_2 = Tag.objects.create( + color=TEST_TAG_COLOR, label=TEST_TAG_LABEL_2 + ) + def test_upload_interactive_view_with_access(self): self._create_tag() + self.grant_access( permission=permission_document_create, obj=self.document_type ) response = self._request_upload_interactive_document_create_view() self.assertEqual(response.status_code, 302) + self.assertTrue(self.tag in Document.objects.first().tags.all()) + + def test_upload_interactive_multiple_tags_view_with_access(self): + self._create_tag() + self._create_tag_2() + + self.grant_access( + permission=permission_document_create, obj=self.document_type + ) + response = self._request_upload_interactive_document_create_view() + self.assertEqual(response.status_code, 302) + + self.assertTrue(self.tag in Document.objects.first().tags.all()) + self.assertTrue(self.tag_2 in Document.objects.first().tags.all()) diff --git a/mayan/apps/tags/wizard_steps.py b/mayan/apps/tags/wizard_steps.py index 5ad9a3e8c2..a9bf47da30 100644 --- a/mayan/apps/tags/wizard_steps.py +++ b/mayan/apps/tags/wizard_steps.py @@ -45,7 +45,7 @@ class WizardStepTags(WizardStep): furl_instance = furl(querystring) Tag = apps.get_model(app_label='tags', model_name='Tag') - for tag in Tag.objects.filter(pk__in=furl_instance.args.getlist('tags')): + for tag in Tag.objects.filter(pk__in=furl_instance.args['tags'].split(',')): tag.documents.add(document)