From 699b1dba877e937a42cf70378fcb94159ac3c8b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 18:42:17 +0000 Subject: [PATCH 1/8] Bump pyjwt from 2.10.0 to 2.10.1 Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 2.10.0 to 2.10.1. - [Release notes](https://github.com/jpadilla/pyjwt/releases) - [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst) - [Commits](https://github.com/jpadilla/pyjwt/compare/2.10.0...2.10.1) --- updated-dependencies: - dependency-name: pyjwt dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Pipfile.lock | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Pipfile.lock b/Pipfile.lock index 61dbfc301..170d9df8f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1466,11 +1466,12 @@ }, "pyjwt": { "hashes": [ - "sha256:543b77207db656de204372350926bed5a86201c4cbff159f623f79c7bb487a15", - "sha256:7628a7eb7938959ac1b26e819a1df0fd3259505627b575e4bad6d08f76db695c" + "sha256:3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953", + "sha256:dcdd193e30abefd5debf142f9adfcdd2b58004e644f25406ffaebd50bd98dacb" ], + "index": "pypi", "markers": "python_version >= '3.9'", - "version": "==2.10.0" + "version": "==2.10.1" }, "pypdf2": { "hashes": [ From 7fe785c88cf6c31f5a79b79e6eab24f01a5a84bf Mon Sep 17 00:00:00 2001 From: "mark.j0hnst0n" Date: Fri, 10 Jan 2025 15:59:34 +0000 Subject: [PATCH 2/8] remove rejected and draft orgs from those checked when exporter trys to create new org --- api/organisations/serializers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/organisations/serializers.py b/api/organisations/serializers.py index 23c5efc63..1f010cce0 100644 --- a/api/organisations/serializers.py +++ b/api/organisations/serializers.py @@ -287,7 +287,11 @@ def validate_registration_number(self, value): # Check for uniqueness only when creating a new Organisation if not self.instance: - if Organisation.objects.filter(registration_number=value).exists(): + if ( + Organisation.objects.filter(registration_number=value) + .exists() + .exclude(status__in=[OrganisationStatus.REJECTED, OrganisationStatus.DRAFT]) + ): raise serializers.ValidationError("This registration number is already in use.") return value From d1cb40f2c5b826cb7edb7664d23e86c13c9f07de Mon Sep 17 00:00:00 2001 From: "mark.j0hnst0n" Date: Fri, 10 Jan 2025 16:13:03 +0000 Subject: [PATCH 3/8] right way round --- api/organisations/serializers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/organisations/serializers.py b/api/organisations/serializers.py index 1f010cce0..0beab5513 100644 --- a/api/organisations/serializers.py +++ b/api/organisations/serializers.py @@ -289,8 +289,8 @@ def validate_registration_number(self, value): if not self.instance: if ( Organisation.objects.filter(registration_number=value) - .exists() .exclude(status__in=[OrganisationStatus.REJECTED, OrganisationStatus.DRAFT]) + .exists() ): raise serializers.ValidationError("This registration number is already in use.") From f2f23b8f5f9fd277adebeab64c0eaf31c5281512 Mon Sep 17 00:00:00 2001 From: "mark.j0hnst0n" Date: Fri, 10 Jan 2025 16:46:46 +0000 Subject: [PATCH 4/8] add test --- api/organisations/tests/test_organisations.py | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/api/organisations/tests/test_organisations.py b/api/organisations/tests/test_organisations.py index ee53cf5d7..f4f1a0f3e 100644 --- a/api/organisations/tests/test_organisations.py +++ b/api/organisations/tests/test_organisations.py @@ -175,7 +175,7 @@ def test_create_commercial_organisation_as_internal_success( "region": "Hertfordshire", "postcode": "AL1 4GT", "city": "St Albans", - } + }, ], [{"address": "123", "country": "PL"}], ] @@ -246,6 +246,48 @@ def test_create_commercial_organisation_as_exporter_success( {"organisation_name": data["name"], "applicant_email": data["user"]["email"]} ) + def test_create_commercial_organisation_as_exporter_success_with_previously_rejected_or_draft_crn(self): + data = { + "name": "Lemonworld Co", + "type": OrganisationType.COMMERCIAL, + "eori_number": "GB123456789000", + "sic_number": "01110", + "vat_number": "GB123456789", + "registration_number": "98765432", + "phone_number": "+441234567895", + "website": "", + "site": { + "name": "Headquarters", + "address": { + "address_line_1": "42 Industrial Estate", + "address_line_2": "Queens Road", + "region": "Hertfordshire", + "postcode": "AL1 4GT", + "city": "St Albans", + }, + }, + "user": {"email": "trinity@bsg.com"}, + } + response = self.client.post( + self.url, data, **{EXPORTER_USER_TOKEN_HEADER: user_to_token(self.exporter_user.baseuser_ptr)} + ) + + self.assertEqual(response.status_code, status.HTTP_201_CREATED) + organisation = Organisation.objects.get(id=response.json()["id"]) + organisation.status = OrganisationStatus.REJECTED + organisation.save() + response = self.client.post( + self.url, data, **{EXPORTER_USER_TOKEN_HEADER: user_to_token(self.exporter_user.baseuser_ptr)} + ) + + self.assertEqual(response.status_code, status.HTTP_201_CREATED) + + organisation = Organisation.objects.get(id=response.json()["id"]) + organisation.status = OrganisationStatus.DRAFT + organisation.save() + + self.assertEqual(response.status_code, status.HTTP_201_CREATED) + def test_create_organisation_phone_number_mandatory(self): data = { "name": "Lemonworld Co", From 78c4eea4b4477117a91a2fcacc80d52fb179f7fd Mon Sep 17 00:00:00 2001 From: "mark.j0hnst0n" Date: Mon, 13 Jan 2025 11:13:10 +0000 Subject: [PATCH 5/8] add more test info --- api/organisations/tests/test_organisations.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/organisations/tests/test_organisations.py b/api/organisations/tests/test_organisations.py index f4f1a0f3e..12ea5588e 100644 --- a/api/organisations/tests/test_organisations.py +++ b/api/organisations/tests/test_organisations.py @@ -285,6 +285,9 @@ def test_create_commercial_organisation_as_exporter_success_with_previously_reje organisation = Organisation.objects.get(id=response.json()["id"]) organisation.status = OrganisationStatus.DRAFT organisation.save() + response = self.client.post( + self.url, data, **{EXPORTER_USER_TOKEN_HEADER: user_to_token(self.exporter_user.baseuser_ptr)} + ) self.assertEqual(response.status_code, status.HTTP_201_CREATED) From 6a38262de6eac6234a51a2bd10c2df618a8c1360 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 15:26:32 +0000 Subject: [PATCH 6/8] Bump ipython from 7.34.0 to 8.10.0 Bumps [ipython](https://github.com/ipython/ipython) from 7.34.0 to 8.10.0. - [Release notes](https://github.com/ipython/ipython/releases) - [Commits](https://github.com/ipython/ipython/compare/7.34.0...8.10.0) --- updated-dependencies: - dependency-name: ipython dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Pipfile | 2 +- Pipfile.lock | 46 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 39 insertions(+), 9 deletions(-) diff --git a/Pipfile b/Pipfile index 3c72de655..94e760f32 100644 --- a/Pipfile +++ b/Pipfile @@ -64,7 +64,7 @@ django-log-formatter-ecs = "==0.0.5" whitenoise = "~=5.3.0" django-audit-log-middleware = "~=0.0.4" django-extensions = "~=3.2.3" -ipython = "~=7.34.0" +ipython = "~=8.10.0" celery = "~=5.3.0" redis = "~=4.4.4" django-test-migrations = "~=1.2.0" diff --git a/Pipfile.lock b/Pipfile.lock index 180e4f2d6..4f9d4fb9c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "5b04da23ff858fb3447d3919e58d73cec97e41e8a970308baa2c7521fe83cab9" + "sha256": "dd51b2348a4b7c041fc8e5189c945327bdc8521154c3ca75f7a66a88c10b5ad6" }, "pipfile-spec": 6, "requires": { @@ -33,6 +33,14 @@ "markers": "python_version >= '3.8'", "version": "==3.8.1" }, + "asttokens": { + "hashes": [ + "sha256:0dcd8baa8d62b0c1d118b399b2ddba3c4aff271d0d7a9e0d4c1681c79035bbc7", + "sha256:e3078351a059199dd5138cb1c706e6430c05eff2ff136af5eb4790f9d28932e2" + ], + "markers": "python_version >= '3.8'", + "version": "==3.0.0" + }, "async-timeout": { "hashes": [ "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c", @@ -734,6 +742,14 @@ "markers": "python_version >= '3.8'", "version": "==2.0.0" }, + "executing": { + "hashes": [ + "sha256:8d63781349375b5ebccc3142f4b30350c0cd9c79f921cde38be2be4637e98eaf", + "sha256:8ea27ddd260da8150fa5a708269c4a10e76161e2496ec3e587da9e3c0fe4b9ab" + ], + "markers": "python_version >= '3.8'", + "version": "==2.1.0" + }, "factory-boy": { "hashes": [ "sha256:728df59b372c9588b83153facf26d3d28947fc750e8e3c95cefa9bed0e6394ee", @@ -1022,12 +1038,12 @@ }, "ipython": { "hashes": [ - "sha256:af3bdb46aa292bce5615b1b2ebc76c2080c5f77f54bda2ec72461317273e7cd6", - "sha256:c175d2440a1caff76116eb719d40538fbb316e214eda85c5515c303aacbfb23e" + "sha256:b13a1d6c1f5818bd388db53b7107d17454129a70de2b87481d555daede5eb49e", + "sha256:b38c31e8fc7eff642fc7c597061fff462537cf2314e3225a19c906b7b0d8a345" ], "index": "pypi", - "markers": "python_version >= '3.7'", - "version": "==7.34.0" + "markers": "python_version >= '3.8'", + "version": "==8.10.0" }, "jdcal": { "hashes": [ @@ -1440,6 +1456,13 @@ ], "version": "==0.7.0" }, + "pure-eval": { + "hashes": [ + "sha256:1db8e35b67b3d218d818ae653e27f06c3aa420901fa7b081ca98cbedc874e0d0", + "sha256:5f4e983f40564c576c7c8635ae88db5956bb2229d7e9237d03b3c0b0190eaf42" + ], + "version": "==0.2.3" + }, "pycodestyle": { "hashes": [ "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3", @@ -1458,11 +1481,11 @@ }, "pygments": { "hashes": [ - "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199", - "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a" + "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", + "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c" ], "markers": "python_version >= '3.8'", - "version": "==2.18.0" + "version": "==2.19.1" }, "pyjwt": { "hashes": [ @@ -1744,6 +1767,13 @@ "markers": "python_version >= '3.8'", "version": "==0.5.2" }, + "stack-data": { + "hashes": [ + "sha256:836a778de4fec4dcd1dcd89ed8abff8a221f58308462e1c4aa2a3cf30148f0b9", + "sha256:d5558e0c25a4cb0853cddad3d77da9891a08cb85dd9f9f91b9f8cd66e511e695" + ], + "version": "==0.6.3" + }, "tblib": { "hashes": [ "sha256:059bd77306ea7b419d4f76016aef6d7027cc8a0785579b5aad198803435f882c", From 54567d08293c63ece8345b77eb223e45ec185098 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 18:57:17 +0000 Subject: [PATCH 7/8] Bump django from 4.2.16 to 4.2.17 Bumps [django](https://github.com/django/django) from 4.2.16 to 4.2.17. - [Commits](https://github.com/django/django/compare/4.2.16...4.2.17) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Pipfile | 2 +- Pipfile.lock | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index 3c72de655..2899f6de2 100644 --- a/Pipfile +++ b/Pipfile @@ -69,7 +69,7 @@ celery = "~=5.3.0" redis = "~=4.4.4" django-test-migrations = "~=1.2.0" django-silk = "~=5.0.3" -django = "~=4.2.15" +django = "~=4.2.17" django-queryable-properties = "~=1.9.1" database-sanitizer = ">=1.1.0" django-reversion = ">=5.0.12" diff --git a/Pipfile.lock b/Pipfile.lock index 180e4f2d6..5ab51e6cf 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "5b04da23ff858fb3447d3919e58d73cec97e41e8a970308baa2c7521fe83cab9" + "sha256": "9d8cfee695746c852beffca687bfb47bfb9209f7f64d0c72d3523932882bf00d" }, "pipfile-spec": 6, "requires": { @@ -463,12 +463,12 @@ }, "django": { "hashes": [ - "sha256:1ddc333a16fc139fd253035a1606bb24261951bbc3a6ca256717fa06cc41a898", - "sha256:6f1616c2786c408ce86ab7e10f792b8f15742f7b7b7460243929cb371e7f1dad" + "sha256:3a93350214ba25f178d4045c0786c61573e7dbfa3c509b3551374f1e11ba8de0", + "sha256:6b56d834cc94c8b21a8f4e775064896be3b4a4ca387f2612d4406a5927cd2fdc" ], "index": "pypi", "markers": "python_version >= '3.8'", - "version": "==4.2.16" + "version": "==4.2.17" }, "django-activity-stream": { "hashes": [ @@ -1782,7 +1782,7 @@ "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d", "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8" ], - "markers": "python_version >= '3.8'", + "markers": "python_version < '3.10'", "version": "==4.12.2" }, "tzdata": { From cccd94954e9060d4f0d0180fea19da4ec738b5b1 Mon Sep 17 00:00:00 2001 From: Tomos Williams Date: Tue, 14 Jan 2025 09:35:40 +0000 Subject: [PATCH 8/8] resolve conflict --- Pipfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pipfile.lock b/Pipfile.lock index 169dff45a..70a4e4f7f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "9d8cfee695746c852beffca687bfb47bfb9209f7f64d0c72d3523932882bf00d" + "sha256": "3466bbe6fe8a352e4e7c997025e60e49b6723bebadd605fd74d5c8beaab08f43" }, "pipfile-spec": 6, "requires": {