diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 9f9a4d11..77a94cf0 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,7 +1,7 @@ [bumpversion] commit = False tag = False -current_version = 1.4.2 +current_version = 1.4.3 parse = (?P\d+)\.(?P\d+)\.(?P\d+)([-](?P(rc|alpha))+(?P\d+))? serialize = {major}.{minor}.{patch}-{release}{build} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65ad0095..98cd48a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,6 @@ on: pull_request: branches: - "develop" - - "master" env: DJANGO_SETTINGS_MODULE: drc.conf.ci @@ -104,7 +103,6 @@ jobs: - check-format - check-sort - check-oas - - unit-tests steps: - name: Checkout diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bef7ec13..a0e6f080 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,11 @@ =========== Wijzigingen +=========== +1.4.3 (2023-10-24) +=========== + +- **Changed:** `lock` attribute shows up in EIO.bestandsdelen POST response after creating an EIO. + =========== 1.4.2 (2023-09-25) =========== diff --git a/README.rst b/README.rst index 3c94fcb1..e3b746d3 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Documenten API ============== -:Version: 1.4.2 +:Version: 1.4.3 :Source: https://github.com/VNG-Realisatie/documenten-api :Keywords: zaken, zaakgericht werken, GEMMA, RGBZ, DRC @@ -24,6 +24,8 @@ Versie Release datum API specificatie master n.v.t. `ReDoc `_, `Scopes `_ `Berichtkenmerken `_ `Swagger `_ (`verschillen `_) +1.4.3 2023-10-24 `ReDoc `_, `Scopes `_ `Berichtkenmerken `_ + `Swagger `_ 1.4.1 2023-08-29 `ReDoc `_, `Scopes `_ `Berichtkenmerken `_ `Swagger `_ 1.4.0 2023-08-22 `ReDoc `_, `Scopes `_ `Berichtkenmerken `_ diff --git a/package.json b/package.json index b7a4c1dd..45befd19 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "drc", - "version": "1.4.2", + "version": "1.4.3", "description": "drc referentie implementatie API", "main": "src/index.js", "directories": { diff --git a/src/drc/__init__.py b/src/drc/__init__.py index 1264f0ce..dc821658 100644 --- a/src/drc/__init__.py +++ b/src/drc/__init__.py @@ -7,7 +7,7 @@ import re from collections import namedtuple -__version__ = "1.4.2" +__version__ = "1.4.3" __author__ = "VNG Realisatie" __homepage__ = "https://github.com/VNG-Realisatie/documenten-api" __docformat__ = "restructuredtext" diff --git a/src/drc/api/serializers/bestandsdeel.py b/src/drc/api/serializers/bestandsdeel.py index 9b46acd1..10054de7 100644 --- a/src/drc/api/serializers/bestandsdeel.py +++ b/src/drc/api/serializers/bestandsdeel.py @@ -7,7 +7,6 @@ class BestandsDeelSerializer(serializers.HyperlinkedModelSerializer): lock = serializers.CharField( - write_only=True, help_text="Hash string, which represents id of the lock of related informatieobject", ) diff --git a/src/drc/api/serializers/enkelvoudig_informatieobject.py b/src/drc/api/serializers/enkelvoudig_informatieobject.py index 4d17de29..0d74ac8f 100644 --- a/src/drc/api/serializers/enkelvoudig_informatieobject.py +++ b/src/drc/api/serializers/enkelvoudig_informatieobject.py @@ -238,7 +238,10 @@ def _create_bestandsdeel(self, full_size, canonical): for i in range(parts): chunk_size = min(settings.CHUNK_SIZE, full_size) BestandsDeel.objects.create( - informatieobject=canonical, omvang=chunk_size, volgnummer=i + 1 + informatieobject=canonical, + omvang=chunk_size, + volgnummer=i + 1, + lock=canonical.lock, ) full_size -= chunk_size @@ -266,10 +269,6 @@ def create(self, validated_data): eio.ondertekening = ondertekening eio.save() - # large file process - if not eio.inhoud and eio.bestandsomvang and eio.bestandsomvang > 0: - self._create_bestandsdeel(validated_data["bestandsomvang"], canonical) - # create empty file if size == 0 if eio.bestandsomvang == 0: eio.inhoud.save("empty_file", ContentFile("")) @@ -381,6 +380,8 @@ def create(self, validated_data): # lock document if it is a large file upload if not eio.inhoud and eio.bestandsomvang and eio.bestandsomvang > 0: eio.canonical.lock = uuid.uuid4().hex + # large file process + self._create_bestandsdeel(validated_data["bestandsomvang"], eio.canonical) eio.canonical.save() return eio diff --git a/src/drc/api/tests/test_dso_api_strategy.py b/src/drc/api/tests/test_dso_api_strategy.py index a5b2a31f..79d4d0fa 100644 --- a/src/drc/api/tests/test_dso_api_strategy.py +++ b/src/drc/api/tests/test_dso_api_strategy.py @@ -23,7 +23,7 @@ def test_api_19_documentation_version_yaml(self): @override_settings(ROOT_URLCONF="drc.api.tests.test_urls") def test_api_24_version_header(self): response = self.client.get("/test-view") - self.assertEqual(response["API-version"], "1.4.2") + self.assertEqual(response["API-version"], "1.4.3") class DSOApi50Tests(APITestCase): diff --git a/src/drc/conf/api.py b/src/drc/conf/api.py index b5e85cc7..81197d6b 100644 --- a/src/drc/conf/api.py +++ b/src/drc/conf/api.py @@ -2,7 +2,7 @@ from vng_api_common.conf.api import * # noqa - imports white-listed -API_VERSION = "1.4.2" +API_VERSION = "1.4.3" REST_FRAMEWORK = BASE_REST_FRAMEWORK.copy() diff --git a/src/drc/datamodel/migrations/0064_bestandsdeel_lock.py b/src/drc/datamodel/migrations/0064_bestandsdeel_lock.py new file mode 100644 index 00000000..f10a4405 --- /dev/null +++ b/src/drc/datamodel/migrations/0064_bestandsdeel_lock.py @@ -0,0 +1,23 @@ +# Generated by Django 3.2.13 on 2023-10-19 12:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("datamodel", "0063_enkelvoudiginformatieobject_trefwoorden"), + ] + + operations = [ + migrations.AddField( + model_name="bestandsdeel", + name="lock", + field=models.CharField( + blank=True, + help_text="Hash string, which represents id of the lock of related informatieobject", + max_length=255, + null=True, + ), + ), + ] diff --git a/src/drc/datamodel/models/bestandsdeel.py b/src/drc/datamodel/models/bestandsdeel.py index 5c038384..c5796363 100644 --- a/src/drc/datamodel/models/bestandsdeel.py +++ b/src/drc/datamodel/models/bestandsdeel.py @@ -28,6 +28,12 @@ class BestandsDeel(models.Model): blank=True, help_text=_("De (binaire) bestandsinhoud van dit specifieke bestandsdeel."), ) + lock = models.CharField( + default="", + blank=True, + max_length=100, + help_text=_("Hash string, which represents id of the lock"), + ) class Meta: verbose_name = "bestands deel" diff --git a/src/openapi.yaml b/src/openapi.yaml index 97060041..3d0eef1b 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: Documenten API - version: 1.4.2 + version: 1.4.3 description: "Een API om een documentregistratiecomponent (DRC) te benaderen.\n\n\ In een documentregistratiecomponent worden INFORMATIEOBJECTen opgeslagen. Een\n\ @@ -83,7 +83,6 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/BestandsDeelRequest' - required: true security: - JWT-Claims: - documenten.bijwerken @@ -5451,7 +5450,13 @@ components: zeggen: het aantal bytes dat staat genoemd bij grootte is daadwerkelijk ontvangen.' title: voltooid + lock: + type: string + readOnly: true + description: Hash string, which represents id of the lock of related informatieobject + title: lock required: + - lock - omvang - url - volgnummer @@ -5465,14 +5470,6 @@ components: writeOnly: true description: De (binaire) bestandsinhoud van dit specifieke bestandsdeel. title: inhoud - lock: - type: string - writeOnly: true - minLength: 1 - description: Hash string, which represents id of the lock of related informatieobject - title: lock - required: - - lock BestandsDeelResponse: type: object properties: diff --git a/src/resources.md b/src/resources.md index ef74e9b5..c4507ab4 100755 --- a/src/resources.md +++ b/src/resources.md @@ -60,6 +60,7 @@ Objecttype op [GEMMA Online](https://www.gemmaonline.nl/index.php/Rgbz_1.0/doc/o | volgnummer | Een volgnummer dat de volgorde van de bestandsdelen aangeeft. | integer | ja | ~~C~~​R​~~U~~​~~D~~ | | omvang | De grootte van dit specifieke bestandsdeel. | integer | ja | ~~C~~​R​~~U~~​~~D~~ | | voltooid | Indicatie of dit bestandsdeel volledig is geupload. Dat wil zeggen: het aantal bytes dat staat genoemd bij grootte is daadwerkelijk ontvangen. | boolean | ja | ~~C~~​R​~~U~~​~~D~~ | +| lock | Hash string, which represents id of the lock of related informatieobject | string | ja | ~~C~~​R​~~U~~​~~D~~ | ## EnkelvoudigInformatieObject