From e43fe627d9a45e47073d83df066cedb8b648105e Mon Sep 17 00:00:00 2001 From: joerivrij Date: Wed, 1 Mar 2023 16:29:50 +0100 Subject: [PATCH] feat: adds notification env flag --- CHANGELOG.rst | 8 ++++++++ README.rst | 2 +- package.json | 2 +- src/drc/__init__.py | 2 +- src/drc/api/tests/test_dso_api_strategy.py | 2 +- src/drc/conf/api.py | 2 +- src/drc/conf/dev.py | 3 +++ src/drc/conf/docker.py | 3 +++ src/openapi.yaml | 2 +- 9 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 459a1c2b..ac8f3f00 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,14 @@ Wijzigingen =========== +1.2.3 (2022-03-01) +=========== + +Implementation changes +---------------------- + +* Added ``ENV`` variable to turn off Notifications when running in a Container + 1.2.2 (2022-02-22) =========== diff --git a/README.rst b/README.rst index b888096e..10e41978 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ Documenten API ============== -:Version: 1.2.2 +:Version: 1.2.3 :Source: https://github.com/VNG-Realisatie/documenten-api :Keywords: zaken, zaakgericht werken, GEMMA, RGBZ, DRC diff --git a/package.json b/package.json index 4b1fac7c..5e593e85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "drc", - "version": "1.2.2", + "version": "1.2.3", "description": "drc referentie implementatie API", "main": "src/index.js", "directories": { diff --git a/src/drc/__init__.py b/src/drc/__init__.py index 8154c47e..e025115a 100644 --- a/src/drc/__init__.py +++ b/src/drc/__init__.py @@ -7,7 +7,7 @@ import re from collections import namedtuple -__version__ = "1.2.2" +__version__ = "1.2.3" __author__ = "VNG Realisatie" __homepage__ = "https://github.com/VNG-Realisatie/documenten-api" __docformat__ = "restructuredtext" diff --git a/src/drc/api/tests/test_dso_api_strategy.py b/src/drc/api/tests/test_dso_api_strategy.py index 857d63dc..48f66a2d 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.2.2") + self.assertEqual(response["API-version"], "1.2.3") class DSOApi50Tests(APITestCase): diff --git a/src/drc/conf/api.py b/src/drc/conf/api.py index a3375eee..397e6490 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.2.2" +API_VERSION = "1.2.3" REST_FRAMEWORK = BASE_REST_FRAMEWORK.copy() REST_FRAMEWORK["PAGE_SIZE"] = 100 diff --git a/src/drc/conf/dev.py b/src/drc/conf/dev.py index deef4deb..264f8eb4 100644 --- a/src/drc/conf/dev.py +++ b/src/drc/conf/dev.py @@ -1,6 +1,8 @@ import os import sys +from .docker import getenv # noqa isort:skip + os.environ.setdefault( "SECRET_KEY", "%jp_t1u42ldzeb4s2d4tqj3ythtm)2)^ph%-b71#$*7_=&-(!g" ) @@ -58,6 +60,7 @@ # Custom settings # ENVIRONMENT = "development" +NOTIFICATIONS_DISABLED = bool(getenv("NOTIFICATIONS_DISABLED", False)) # # Library settings diff --git a/src/drc/conf/docker.py b/src/drc/conf/docker.py index 8dfbef0f..89b24e2e 100644 --- a/src/drc/conf/docker.py +++ b/src/drc/conf/docker.py @@ -78,6 +78,9 @@ def getenv(key, default=None, required=False, split=False): # Additional Django settings # +# turn off notifications in containers +NOTIFICATIONS_DISABLED = bool(getenv("NOTIFICATIONS_DISABLED", False)) + # Disable security measures for development SESSION_COOKIE_SECURE = getenv("SESSION_COOKIE_SECURE", False) SESSION_COOKIE_HTTPONLY = getenv("SESSION_COOKIE_HTTPONLY", False) diff --git a/src/openapi.yaml b/src/openapi.yaml index fcc7cb17..5dc4f79f 100644 --- a/src/openapi.yaml +++ b/src/openapi.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: title: Documenten API - version: 1.2.2 + version: 1.2.3 description: "Een API om een documentregistratiecomponent (DRC) te benaderen.\n\n\ In een documentregistratiecomponent worden INFORMATIEOBJECTen opgeslagen. Een\n\