From eaf76ad33c976748c5aba474d4d7d09ce26b22ae Mon Sep 17 00:00:00 2001 From: Domenico Date: Fri, 3 Jun 2022 21:05:57 -0500 Subject: [PATCH 1/2] update djangolib --- Pipfile | 2 +- Pipfile.lock | 8 ++++---- src/etools/config/settings/base.py | 5 +++++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Pipfile b/Pipfile index 110404520a..22a9c9abd7 100644 --- a/Pipfile +++ b/Pipfile @@ -73,7 +73,7 @@ social-auth-app-django = "==5.0" social-auth-core = {extras = ["azuread"],version = "==4.2"} tenant-schemas-celery = "==2.0.0" unicef-attachments = "==0.11" -unicef-djangolib = "==0.5.4" +unicef-djangolib = "==0.6" unicef-locations = "==4.0.1" unicef-notification = "==1.1" unicef-restlib = "==0.7" diff --git a/Pipfile.lock b/Pipfile.lock index e14710e163..07e2bda29f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "e64cf0f85bde902ceb0e195b38d6178a885abc2c279d4d1de69f061475603bc7" + "sha256": "0a3d502b33bc2fa2222f33a28eb448c150f29169e32169fbade5defe83827f1a" }, "pipfile-spec": 6, "requires": { @@ -1400,11 +1400,11 @@ }, "unicef-djangolib": { "hashes": [ - "sha256:8838149978f162a60b2b6bc3564ee2a84c72a0ed92330bb9b21939ba4cffd186", - "sha256:b488629b2d6493ab0f46321e02b1c5287a18e9b7caabc1fe8b660d6d6fda924f" + "sha256:138ba8bd933d521216f0f6cd81fcc59246e0c14d0103e91924b4f7198f6e586f", + "sha256:9e24178784b3d286d0e01b9c99444c44554681555f7e5c539b1656ff6519867e" ], "index": "pypi", - "version": "==0.5.4" + "version": "==0.6" }, "unicef-locations": { "hashes": [ diff --git a/src/etools/config/settings/base.py b/src/etools/config/settings/base.py index 7df4b1c12e..3d04930773 100644 --- a/src/etools/config/settings/base.py +++ b/src/etools/config/settings/base.py @@ -117,6 +117,7 @@ def get_from_secrets_or_env(var_name, default=None): # DJANGO: HTTP MIDDLEWARE = ( + 'unicef_djangolib.middleware.HealthCheckMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'etools.applications.core.auth.CustomSocialAuthExceptionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -156,6 +157,7 @@ def get_from_secrets_or_env(var_name, default=None): os.path.join(os.path.dirname(etools.__file__), 'applications', 'core', 'data'), ) SHARED_APPS = ( + 'unicef_djangolib', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', @@ -578,3 +580,6 @@ def before_send(event, hint): ETOOLS_OFFLINE_TASK_APP = "etools.config.celery.get_task_app" UNICEF_LOCATIONS_MODEL = 'locations.Location' + +PROJECT_NAME = etools.NAME +PROJECT_VERSION = etools.VERSION From ec5810d8adcda99dea613bfaaba55dad3cd7d153 Mon Sep 17 00:00:00 2001 From: Roman Karpovich Date: Tue, 7 Jun 2022 15:55:08 +0800 Subject: [PATCH 2/2] fix tests --- .../field_monitoring/data_collection/tests/test_views.py | 2 +- .../field_monitoring/fm_settings/tests/factories.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/etools/applications/field_monitoring/data_collection/tests/test_views.py b/src/etools/applications/field_monitoring/data_collection/tests/test_views.py index 10a76dda9b..a3f2e1b7b2 100644 --- a/src/etools/applications/field_monitoring/data_collection/tests/test_views.py +++ b/src/etools/applications/field_monitoring/data_collection/tests/test_views.py @@ -618,7 +618,7 @@ def test_list(self): checklist = self.activity.checklists.first() self.assertTrue(checklist.overall_findings.exists()) - AttachmentFactory(content_object=checklist.overall_findings.first()) + AttachmentFactory(content_object=checklist.overall_findings.first(), code='attachments') with self.assertNumQueries(9): response = self._test_list(self.unicef_user, [self.overall_finding]) diff --git a/src/etools/applications/field_monitoring/fm_settings/tests/factories.py b/src/etools/applications/field_monitoring/fm_settings/tests/factories.py index 62404159b8..a4cda0d2b7 100644 --- a/src/etools/applications/field_monitoring/fm_settings/tests/factories.py +++ b/src/etools/applications/field_monitoring/fm_settings/tests/factories.py @@ -92,4 +92,4 @@ def attachments(self, create, extracted, count, **kwargs): return for i in range(count): - AttachmentFactory(content_object=self) + AttachmentFactory(content_object=self, code='attachments')