commonground-api-common 1.12.2__tar.gz → 1.13.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (223) hide show
  1. commonground_api_common-1.13.1/CHANGELOG.rst +17 -0
  2. {commonground-api-common-1.12.2/commonground_api_common.egg-info → commonground_api_common-1.13.1}/PKG-INFO +5 -6
  3. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1/commonground_api_common.egg-info}/PKG-INFO +5 -6
  4. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/commonground_api_common.egg-info/SOURCES.txt +1 -0
  5. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/commonground_api_common.egg-info/requires.txt +2 -3
  6. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/setup.cfg +12 -15
  7. commonground_api_common-1.13.1/vng_api_common/__init__.py +1 -0
  8. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/models.py +24 -0
  9. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/validators.py +5 -11
  10. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/caching/etags.py +2 -1
  11. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/inspectors/query.py +1 -6
  12. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/models.py +10 -0
  13. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/api/views.py +4 -4
  14. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/validators.py +24 -45
  15. commonground-api-common-1.12.2/vng_api_common/__init__.py +0 -1
  16. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/MANIFEST.in +0 -0
  17. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/README.rst +0 -0
  18. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/bin/generate_schema +0 -0
  19. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/bin/patch_content_types +0 -0
  20. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/bin/use_external_components +0 -0
  21. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/commonground_api_common.egg-info/dependency_links.txt +0 -0
  22. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/commonground_api_common.egg-info/not-zip-safe +0 -0
  23. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/commonground_api_common.egg-info/top_level.txt +0 -0
  24. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/pyproject.toml +0 -0
  25. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/setup.py +0 -0
  26. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_autorisatie_validation.py +0 -0
  27. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_cache_headers.py +0 -0
  28. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_check_query_params.py +0 -0
  29. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_checks.py +0 -0
  30. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_choices.py +0 -0
  31. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_config.py +0 -0
  32. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_content_type_headers.py +0 -0
  33. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_filters.py +0 -0
  34. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_gegevensgroepen.py +0 -0
  35. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_get_resource.py +0 -0
  36. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_jwt_decoding.py +0 -0
  37. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_jwtsecrets.py +0 -0
  38. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_nested_serializer_validation.py +0 -0
  39. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_permissions.py +0 -0
  40. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_publish_validator.py +0 -0
  41. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_schema_root_tags.py +0 -0
  42. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_server_errors.py +0 -0
  43. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_utils.py +0 -0
  44. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_validators.py +0 -0
  45. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/tests/test_views.py +0 -0
  46. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/admin.py +0 -0
  47. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/api/__init__.py +0 -0
  48. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/api/permissions.py +0 -0
  49. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/api/serializers.py +0 -0
  50. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/api/urls.py +0 -0
  51. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/api/views.py +0 -0
  52. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/apps.py +0 -0
  53. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/__init__.py +0 -0
  54. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/admin.py +0 -0
  55. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/api/__init__.py +0 -0
  56. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/api/scopes.py +0 -0
  57. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/api/serializers.py +0 -0
  58. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/apps.py +0 -0
  59. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/audits.py +0 -0
  60. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0001_initial.py +0 -0
  61. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0002_auto_20190516_0830.py +0 -0
  62. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0003_auto_20190517_0844.py +0 -0
  63. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0004_auto_20190520_1238.py +0 -0
  64. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0005_auto_20190520_1450.py +0 -0
  65. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0006_audittrail_toelichting.py +0 -0
  66. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0007_auto_20190522_0916.py +0 -0
  67. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0008_audittrail_resource_weergave.py +0 -0
  68. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0009_auto_20190712_1643.py +0 -0
  69. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0010_audittrail_request_id.py +0 -0
  70. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0011_auto_20190918_1335.py +0 -0
  71. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0012_auto_20200619_0545.py +0 -0
  72. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0012_remove_audittrail_request_id.py +0 -0
  73. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0013_audittrail_logrecord_id.py +0 -0
  74. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0013_auto_20201207_0846.py +0 -0
  75. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0014_auto_20201221_0905.py +0 -0
  76. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0014_auto_20210323_1654.py +0 -0
  77. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0015_auto_20220318_1608.py +0 -0
  78. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0016_merge_20220607_0517.py +0 -0
  79. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0017_alter_audittrail_bron.py +0 -0
  80. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/0018_auto_20221212_0745.py +0 -0
  81. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/__init__.py +0 -0
  82. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/migrations/_operations.py +0 -0
  83. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/models.py +0 -0
  84. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/audittrails/viewsets.py +0 -0
  85. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/__init__.py +0 -0
  86. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/admin.py +0 -0
  87. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0001_initial.py +0 -0
  88. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0002_authorizationsconfig.py +0 -0
  89. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0003_auto_20190502_0409.py +0 -0
  90. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0004_auto_20190503_0941.py +0 -0
  91. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0005_auto_20190506_0842.py +0 -0
  92. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0006_auto_20190506_0901.py +0 -0
  93. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0007_auto_20190506_1212.py +0 -0
  94. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0008_auto_20190712_1541.py +0 -0
  95. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0009_update_enums.py +0 -0
  96. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0010_auto_20190712_1643.py +0 -0
  97. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0011_auto_20191114_0728.py +0 -0
  98. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0012_auto_20200619_0545.py +0 -0
  99. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0013_auto_20201207_0846.py +0 -0
  100. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0014_auto_20201221_0905.py +0 -0
  101. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/0015_auto_20220318_1608.py +0 -0
  102. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/migrations/__init__.py +0 -0
  103. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/authorizations/serializers.py +0 -0
  104. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/caching/__init__.py +0 -0
  105. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/caching/decorators.py +0 -0
  106. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/caching/introspection.py +0 -0
  107. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/caching/models.py +0 -0
  108. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/caching/registry.py +0 -0
  109. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/caching/signals.py +0 -0
  110. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/checks.py +0 -0
  111. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/choices.py +0 -0
  112. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/client.py +0 -0
  113. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/compat.py +0 -0
  114. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/conf/__init__.py +0 -0
  115. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/conf/api.py +0 -0
  116. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/constants.py +0 -0
  117. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/db/__init__.py +0 -0
  118. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/db/operations.py +0 -0
  119. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/decorators.py +0 -0
  120. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/descriptors.py +0 -0
  121. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/doc.py +0 -0
  122. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/exception_handling.py +0 -0
  123. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/exceptions.py +0 -0
  124. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/fields.py +0 -0
  125. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/filters.py +0 -0
  126. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/filtersets.py +0 -0
  127. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/generators.py +0 -0
  128. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/geo.py +0 -0
  129. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/inspectors/__init__.py +0 -0
  130. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/inspectors/cache.py +0 -0
  131. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/inspectors/fields.py +0 -0
  132. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/inspectors/files.py +0 -0
  133. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/inspectors/geojson.py +0 -0
  134. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/inspectors/polymorphic.py +0 -0
  135. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/inspectors/utils.py +0 -0
  136. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/inspectors/view.py +0 -0
  137. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/locale/nl/LC_MESSAGES/django.mo +0 -0
  138. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/locale/nl/LC_MESSAGES/django.po +0 -0
  139. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/management/__init__.py +0 -0
  140. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/management/commands/__init__.py +0 -0
  141. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/management/commands/generate_autorisaties.py +0 -0
  142. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/management/commands/generate_notificaties.py +0 -0
  143. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/management/commands/generate_swagger.py +0 -0
  144. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/management/commands/patch_error_contenttypes.py +0 -0
  145. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/management/commands/use_external_components.py +0 -0
  146. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/middleware.py +0 -0
  147. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/migrations/0001_initial.py +0 -0
  148. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/migrations/0002_apicredential.py +0 -0
  149. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/migrations/0003_auto_20190417_1145.py +0 -0
  150. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/migrations/0004_auto_20190517_0903.py +0 -0
  151. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/migrations/0005_auto_20190614_1346.py +0 -0
  152. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/migrations/__init__.py +0 -0
  153. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/mocks.py +0 -0
  154. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/__init__.py +0 -0
  155. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/api/__init__.py +0 -0
  156. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/api/urls.py +0 -0
  157. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/apps.py +0 -0
  158. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/constants.py +0 -0
  159. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/handlers.py +0 -0
  160. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0001_initial.py +0 -0
  161. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0002_subscription__subscription.py +0 -0
  162. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0003_auto_20190319_1048.py +0 -0
  163. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0004_auto_20190325_1313.py +0 -0
  164. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0005_fix_default_nrc.py +0 -0
  165. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0006_auto_20190417_1142.py +0 -0
  166. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0007_auto_20190429_1442.py +0 -0
  167. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0008_auto_20190502_0415.py +0 -0
  168. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0009_auto_20190729_0427.py +0 -0
  169. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/0010_auto_20220704_1419.py +0 -0
  170. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/migrations/__init__.py +0 -0
  171. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/notifications/models.py +0 -0
  172. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/oas.py +0 -0
  173. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/permissions.py +0 -0
  174. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/polymorphism.py +0 -0
  175. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/routers.py +0 -0
  176. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/schema.py +0 -0
  177. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/scopes.py +0 -0
  178. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/search.py +0 -0
  179. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/serializers.py +0 -0
  180. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/css/admin/admin_overrides.css +0 -0
  181. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/css/screen.css +0 -0
  182. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/ico/favicon.png +0 -0
  183. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/img/vng.svg +0 -0
  184. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/LICENSE.txt +0 -0
  185. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/css/all.css +0 -0
  186. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/css/all.min.css +0 -0
  187. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-brands-400.eot +0 -0
  188. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-brands-400.svg +0 -0
  189. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-brands-400.ttf +0 -0
  190. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-brands-400.woff +0 -0
  191. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-brands-400.woff2 +0 -0
  192. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-regular-400.eot +0 -0
  193. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-regular-400.svg +0 -0
  194. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-regular-400.ttf +0 -0
  195. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-regular-400.woff +0 -0
  196. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-regular-400.woff2 +0 -0
  197. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-solid-900.eot +0 -0
  198. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-solid-900.svg +0 -0
  199. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-solid-900.ttf +0 -0
  200. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-solid-900.woff +0 -0
  201. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/static/vng_api_common/libs/fontawesome/webfonts/fa-solid-900.woff2 +0 -0
  202. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/admin/base_site.html +0 -0
  203. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/api_schema_to_markdown_table.md +0 -0
  204. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/autorisaties.md +0 -0
  205. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/includes/kanalen_card.html +0 -0
  206. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/index.html +0 -0
  207. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/master.html +0 -0
  208. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/notificaties.md +0 -0
  209. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/ref/error_detail.html +0 -0
  210. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/ref/scopes.html +0 -0
  211. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templates/vng_api_common/view_config.html +0 -0
  212. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templatetags/__init__.py +0 -0
  213. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/templatetags/vng_api_common.py +0 -0
  214. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/tests/__init__.py +0 -0
  215. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/tests/auth.py +0 -0
  216. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/tests/caching.py +0 -0
  217. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/tests/schema.py +0 -0
  218. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/tests/urls.py +0 -0
  219. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/urls.py +0 -0
  220. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/utils.py +0 -0
  221. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/version.py +0 -0
  222. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/views.py +0 -0
  223. {commonground-api-common-1.12.2 → commonground_api_common-1.13.1}/vng_api_common/viewsets.py +0 -0
@@ -0,0 +1,17 @@
1
+ ==============
2
+ Change history
3
+ ==============
4
+
5
+ 1.13.1 (2024-05-28)
6
+ -------------------
7
+
8
+ * Marked notifications view scopes as private
9
+ * Added natural keys to authorization models
10
+
11
+
12
+ 1.13.0 (2024-03-01)
13
+ -------------------
14
+
15
+ * Added support of Django 4.2
16
+ * Removed support of Python 3.7
17
+ * Added support of Python 3.11
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: commonground-api-common
3
- Version: 1.12.2
3
+ Version: 1.13.1
4
4
  Summary: Commonground API tooling
5
5
  Home-page: https://github.com/maykinmedia/commonground-api-common
6
6
  Author: Maykin Media, VNG-Realisatie
@@ -10,22 +10,22 @@ Keywords: openapi,swagger,django
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Framework :: Django
12
12
  Classifier: Framework :: Django :: 3.2
13
- Classifier: Framework :: Django :: 4.1
13
+ Classifier: Framework :: Django :: 4.2
14
14
  Classifier: Intended Audience :: Developers
15
15
  Classifier: Operating System :: Unix
16
16
  Classifier: Operating System :: MacOS
17
17
  Classifier: Operating System :: Microsoft :: Windows
18
18
  Classifier: Programming Language :: Python :: 3
19
19
  Classifier: Programming Language :: Python :: 3 :: Only
20
- Classifier: Programming Language :: Python :: 3.7
21
20
  Classifier: Programming Language :: Python :: 3.8
22
21
  Classifier: Programming Language :: Python :: 3.9
23
22
  Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
- Requires-Dist: django<4.2,>=3.2.0
25
+ Requires-Dist: django>=3.2.0
26
26
  Requires-Dist: django-filter>=2.0
27
27
  Requires-Dist: django-solo
28
- Requires-Dist: djangorestframework~=3.12.0
28
+ Requires-Dist: djangorestframework>=3.11.0
29
29
  Requires-Dist: djangorestframework_camel_case>=1.2.0
30
30
  Requires-Dist: django-rest-framework-condition
31
31
  Requires-Dist: drf-yasg>=1.20.0
@@ -36,7 +36,6 @@ Requires-Dist: isodate
36
36
  Requires-Dist: notifications-api-common>=0.2.2
37
37
  Requires-Dist: oyaml
38
38
  Requires-Dist: PyJWT>=2.0.0
39
- Requires-Dist: pyyaml
40
39
  Requires-Dist: requests
41
40
  Requires-Dist: coreapi
42
41
  Provides-Extra: markdown-docs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: commonground-api-common
3
- Version: 1.12.2
3
+ Version: 1.13.1
4
4
  Summary: Commonground API tooling
5
5
  Home-page: https://github.com/maykinmedia/commonground-api-common
6
6
  Author: Maykin Media, VNG-Realisatie
@@ -10,22 +10,22 @@ Keywords: openapi,swagger,django
10
10
  Classifier: Development Status :: 5 - Production/Stable
11
11
  Classifier: Framework :: Django
12
12
  Classifier: Framework :: Django :: 3.2
13
- Classifier: Framework :: Django :: 4.1
13
+ Classifier: Framework :: Django :: 4.2
14
14
  Classifier: Intended Audience :: Developers
15
15
  Classifier: Operating System :: Unix
16
16
  Classifier: Operating System :: MacOS
17
17
  Classifier: Operating System :: Microsoft :: Windows
18
18
  Classifier: Programming Language :: Python :: 3
19
19
  Classifier: Programming Language :: Python :: 3 :: Only
20
- Classifier: Programming Language :: Python :: 3.7
21
20
  Classifier: Programming Language :: Python :: 3.8
22
21
  Classifier: Programming Language :: Python :: 3.9
23
22
  Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
24
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
- Requires-Dist: django<4.2,>=3.2.0
25
+ Requires-Dist: django>=3.2.0
26
26
  Requires-Dist: django-filter>=2.0
27
27
  Requires-Dist: django-solo
28
- Requires-Dist: djangorestframework~=3.12.0
28
+ Requires-Dist: djangorestframework>=3.11.0
29
29
  Requires-Dist: djangorestframework_camel_case>=1.2.0
30
30
  Requires-Dist: django-rest-framework-condition
31
31
  Requires-Dist: drf-yasg>=1.20.0
@@ -36,7 +36,6 @@ Requires-Dist: isodate
36
36
  Requires-Dist: notifications-api-common>=0.2.2
37
37
  Requires-Dist: oyaml
38
38
  Requires-Dist: PyJWT>=2.0.0
39
- Requires-Dist: pyyaml
40
39
  Requires-Dist: requests
41
40
  Requires-Dist: coreapi
42
41
  Provides-Extra: markdown-docs
@@ -1,3 +1,4 @@
1
+ CHANGELOG.rst
1
2
  MANIFEST.in
2
3
  README.rst
3
4
  pyproject.toml
@@ -1,7 +1,7 @@
1
- django<4.2,>=3.2.0
1
+ django>=3.2.0
2
2
  django-filter>=2.0
3
3
  django-solo
4
- djangorestframework~=3.12.0
4
+ djangorestframework>=3.11.0
5
5
  djangorestframework_camel_case>=1.2.0
6
6
  django-rest-framework-condition
7
7
  drf-yasg>=1.20.0
@@ -12,7 +12,6 @@ isodate
12
12
  notifications-api-common>=0.2.2
13
13
  oyaml
14
14
  PyJWT>=2.0.0
15
- pyyaml
16
15
  requests
17
16
  coreapi
18
17
 
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = commonground-api-common
3
- version = 1.12.2
3
+ version = 1.13.1
4
4
  description = Commonground API tooling
5
5
  long_description = file: README.rst
6
6
  url = https://github.com/maykinmedia/commonground-api-common
@@ -12,17 +12,17 @@ classifiers =
12
12
  Development Status :: 5 - Production/Stable
13
13
  Framework :: Django
14
14
  Framework :: Django :: 3.2
15
- Framework :: Django :: 4.1
15
+ Framework :: Django :: 4.2
16
16
  Intended Audience :: Developers
17
17
  Operating System :: Unix
18
18
  Operating System :: MacOS
19
19
  Operating System :: Microsoft :: Windows
20
20
  Programming Language :: Python :: 3
21
21
  Programming Language :: Python :: 3 :: Only
22
- Programming Language :: Python :: 3.7
23
22
  Programming Language :: Python :: 3.8
24
23
  Programming Language :: Python :: 3.9
25
24
  Programming Language :: Python :: 3.10
25
+ Programming Language :: Python :: 3.11
26
26
  Topic :: Software Development :: Libraries :: Python Modules
27
27
 
28
28
  [options]
@@ -34,10 +34,10 @@ scripts =
34
34
  bin/patch_content_types
35
35
  bin/use_external_components
36
36
  install_requires =
37
- django>=3.2.0,<4.2
37
+ django>=3.2.0
38
38
  django-filter>=2.0
39
39
  django-solo
40
- djangorestframework~=3.12.0
40
+ djangorestframework>=3.11.0
41
41
  djangorestframework_camel_case>=1.2.0
42
42
  django-rest-framework-condition
43
43
  drf-yasg>=1.20.0
@@ -48,7 +48,6 @@ install_requires =
48
48
  notifications-api-common>=0.2.2
49
49
  oyaml
50
50
  PyJWT>=2.0.0
51
- pyyaml
52
51
  requests
53
52
  coreapi
54
53
  tests_require =
@@ -92,15 +91,13 @@ release =
92
91
  test = pytest
93
92
 
94
93
  [isort]
94
+ profile = black
95
95
  combine_as_imports = true
96
- default_section = THIRDPARTY
97
- include_trailing_comma = true
98
- line_length = 88
99
- multi_line_output = 3
100
- force_grid_wrap = 0
101
- use_parentheses = True
102
- ensure_newline_before_comments = True
103
- skip = env,.tox,.history,.eggs
96
+ skip =
97
+ env
98
+ node_modules
99
+ .tox
100
+ skip_glob = **/migrations/**
104
101
  known_django = django
105
102
  known_first_party = vng_api_common
106
103
  sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
@@ -109,7 +106,7 @@ sections = FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
109
106
  testpaths = tests
110
107
  DJANGO_SETTINGS_MODULE = testapp.settings
111
108
 
112
- [pep8]
109
+ [pycodestyle]
113
110
  max-line-length = 88
114
111
  exclude = env,.tox,doc
115
112
 
@@ -0,0 +1 @@
1
+ __version__ = "1.13.1"
@@ -23,6 +23,11 @@ class AuthorizationsConfig(ClientConfig):
23
23
  verbose_name = _("Autorisatiecomponentconfiguratie")
24
24
 
25
25
 
26
+ class ApplicatieManager(models.Manager):
27
+ def get_by_natural_key(self, uuid):
28
+ return self.get(uuid=uuid)
29
+
30
+
26
31
  class Applicatie(APIMixin, models.Model):
27
32
  """
28
33
  Client level of authorization
@@ -52,10 +57,20 @@ class Applicatie(APIMixin, models.Model):
52
57
  ),
53
58
  )
54
59
 
60
+ objects = ApplicatieManager()
61
+
62
+ def natural_key(self):
63
+ return (str(self.uuid),)
64
+
55
65
  def __str__(self):
56
66
  return f"Applicatie ({self.label})"
57
67
 
58
68
 
69
+ class AutorisatieManager(models.Manager):
70
+ def get_by_natural_key(self, applicatie, component, scopes):
71
+ return self.get(applicatie=applicatie, component=component, scopes=scopes)
72
+
73
+
59
74
  class Autorisatie(APIMixin, models.Model):
60
75
  applicatie = models.ForeignKey(
61
76
  "Applicatie",
@@ -109,6 +124,15 @@ class Autorisatie(APIMixin, models.Model):
109
124
  blank=True,
110
125
  )
111
126
 
127
+ objects = AutorisatieManager()
128
+
129
+ def natural_key(self):
130
+ return (
131
+ self.applicatie,
132
+ self.component,
133
+ self.scopes,
134
+ )
135
+
112
136
  def satisfy_vertrouwelijkheid(self, vertrouwelijkheidaanduiding: str) -> bool:
113
137
  max_confid_level = VertrouwelijkheidsAanduiding.get_choice(
114
138
  self.max_vertrouwelijkheidaanduiding
@@ -15,20 +15,14 @@ class UniqueClientIDValidator:
15
15
  message = _(
16
16
  "The clientID(s) {client_id} are already used in application(s) {app_id}"
17
17
  )
18
+ requires_context = True
18
19
 
19
- def set_context(self, serializer_field):
20
- """
21
- This hook is called by the serializer instance,
22
- prior to the validation call being made.
23
- """
24
- # Determine the existing instance, if this is an update operation.
25
- self.instance = getattr(serializer_field.parent, "instance", None)
26
-
27
- def __call__(self, value: List[str]):
20
+ def __call__(self, value: List[str], serializer_field):
21
+ instance = getattr(serializer_field.parent, "instance", None)
28
22
  qs = Applicatie.objects.all()
29
23
 
30
- if self.instance:
31
- qs = qs.exclude(id=self.instance.id)
24
+ if instance:
25
+ qs = qs.exclude(id=instance.id)
32
26
 
33
27
  existing = qs.filter(client_ids__overlap=value).values_list(
34
28
  "uuid", "client_ids"
@@ -157,7 +157,8 @@ class EtagUpdate:
157
157
  connection = transaction.get_connection(using)
158
158
 
159
159
  func = MethodCallback(etag_update.calculate_new_value)
160
- for _, _func in connection.run_on_commit:
160
+ for run_on_commit in connection.run_on_commit:
161
+ _func = run_on_commit[1]
161
162
  if func == _func:
162
163
  logger.debug(
163
164
  "Update for model instance %r with pk %s was already scheduled",
@@ -1,10 +1,5 @@
1
1
  from django.db import models
2
-
3
- try:
4
- from django.utils.encoding import force_str
5
- except ImportError: # Django < 4.0
6
- from django.utils.encoding import force_text as force_str
7
-
2
+ from django.utils.encoding import force_str
8
3
  from django.utils.translation import gettext as _
9
4
 
10
5
  from django_filters.filters import BaseCSVFilter, ChoiceFilter
@@ -34,6 +34,11 @@ class APIMixin:
34
34
  return url
35
35
 
36
36
 
37
+ class JWTSecretManager(models.Manager):
38
+ def get_by_natural_key(self, identifier):
39
+ return self.get(identifier=identifier)
40
+
41
+
37
42
  class JWTSecret(models.Model):
38
43
  """
39
44
  Store credentials of clients that want to access our API.
@@ -53,6 +58,11 @@ class JWTSecret(models.Model):
53
58
  _("secret"), max_length=255, help_text=_("Secret belonging to the client ID.")
54
59
  )
55
60
 
61
+ objects = JWTSecretManager()
62
+
63
+ def natural_key(self):
64
+ return (self.identifier,)
65
+
56
66
  class Meta:
57
67
  verbose_name = _("client credential")
58
68
  verbose_name_plural = _("client credentials")
@@ -21,9 +21,7 @@ class NotificationBaseView(APIView):
21
21
  swagger_schema = None
22
22
 
23
23
  permission_classes = (AuthScopesRequired,)
24
- required_scopes = Scope(
25
- SCOPE_NOTIFICATIES_PUBLICEREN_LABEL
26
- ) # FIXME: this should be standalone!
24
+ required_scopes = Scope(SCOPE_NOTIFICATIES_PUBLICEREN_LABEL, private=True)
27
25
 
28
26
  def get_serializer(self, *args, **kwargs):
29
27
  return NotificatieSerializer(*args, **kwargs)
@@ -55,7 +53,9 @@ class NotificationBaseView(APIView):
55
53
  class NotificationView(NotificationBaseView):
56
54
  action = "create"
57
55
  permission_classes = (AuthScopesRequired,)
58
- required_scopes = {"create": Scope(SCOPE_NOTIFICATIES_PUBLICEREN_LABEL)}
56
+ required_scopes = {
57
+ "create": Scope(SCOPE_NOTIFICATIES_PUBLICEREN_LABEL, private=True)
58
+ }
59
59
 
60
60
  def create(self, request, *args, **kwargs):
61
61
  return self.post(request, *args, **kwargs)
@@ -206,20 +206,18 @@ class ResourceValidator(URLValidator):
206
206
 
207
207
 
208
208
  class InformatieObjectUniqueValidator(validators.UniqueTogetherValidator):
209
+ requires_context = True
210
+
209
211
  def __init__(self, parent_field, field: str):
210
212
  self.parent_field = parent_field
211
213
  self.field = field
212
214
  super().__init__(None, (parent_field, field))
213
215
 
214
- def set_context(self, serializer_field):
215
- serializer = serializer_field.parent
216
- super().set_context(serializer)
217
-
218
- self.queryset = serializer.Meta.model._default_manager.all()
219
- self.parent_object = serializer.context["parent_object"]
220
-
221
- def __call__(self, informatieobject: str):
222
- attrs = {self.parent_field: self.parent_object, self.field: informatieobject}
216
+ def __call__(self, informatieobject: str, serializer):
217
+ attrs = {
218
+ self.parent_field: serializer.context["parent_object"],
219
+ self.field: informatieobject,
220
+ }
223
221
  super().__call__(attrs)
224
222
 
225
223
 
@@ -232,17 +230,12 @@ class ObjectInformatieObjectValidator:
232
230
  "Het informatieobject is in het DRC nog niet gerelateerd aan dit object."
233
231
  )
234
232
  code = "inconsistent-relation"
233
+ requires_context = True
235
234
 
236
- def set_context(self, serializer):
237
- """
238
- This hook is called by the serializer instance,
239
- prior to the validation call being made.
240
- """
241
- self.parent_object = serializer.context["parent_object"]
242
- self.request = serializer.context["request"]
243
-
244
- def __call__(self, informatieobject: str):
245
- object_url = self.parent_object.get_absolute_api_url(self.request)
235
+ def __call__(self, informatieobject: str, serializer):
236
+ object_url = serializer.context["parent_object"].get_absolute_api_url(
237
+ self.request
238
+ )
246
239
 
247
240
  # dynamic so that it can be mocked in tests easily
248
241
  client = get_client(informatieobject)
@@ -311,40 +304,33 @@ class UniekeIdentificatieValidator:
311
304
 
312
305
  message = _("Deze identificatie bestaat al binnen de organisatie")
313
306
  code = "identificatie-niet-uniek"
307
+ requires_context = True
314
308
 
315
309
  def __init__(self, organisatie_field: str, identificatie_field="identificatie"):
316
310
  self.organisatie_field = organisatie_field
317
311
  self.identificatie_field = identificatie_field
318
312
 
319
- def set_context(self, serializer):
320
- """
321
- This hook is called by the serializer instance,
322
- prior to the validation call being made.
323
- """
324
- # Determine the existing instance, if this is an update operation.
325
- self.instance = getattr(serializer, "instance", None)
326
- self.model = serializer.Meta.model
327
-
328
- def __call__(self, attrs: dict):
313
+ def __call__(self, attrs: dict, serializer):
314
+ instance = getattr(serializer, "instance", None)
329
315
  identificatie = attrs.get(self.identificatie_field)
330
316
  if not identificatie:
331
- if self.instance:
317
+ if instance:
332
318
  # In case of a partial update
333
- identificatie = self.instance.identificatie
319
+ identificatie = instance.identificatie
334
320
  else:
335
321
  # identification is being generated, and the generation checks for
336
322
  # uniqueness
337
323
  return
338
324
 
339
325
  organisatie = attrs.get(self.organisatie_field)
340
- pk = self.instance.pk if self.instance else None
326
+ pk = instance.pk if instance else None
341
327
 
342
328
  # if we're updating an instance, setting the current values will not
343
329
  # trigger an error because the instance-to-be-updated is excluded from
344
330
  # the queryset. If either bronorganisatie or identificatie changes,
345
331
  # and it already exists, it will raise a validation error
346
332
  combination_exists = (
347
- self.model.objects
333
+ serializer.Meta.model.objects
348
334
  # in case of an update, exclude the current object. for a create, this
349
335
  # will be None
350
336
  .exclude(pk=pk)
@@ -370,22 +356,15 @@ class IsImmutableValidator:
370
356
 
371
357
  message = _("Dit veld mag niet gewijzigd worden.")
372
358
  code = "wijzigen-niet-toegelaten"
359
+ requires_context = True
373
360
 
374
- def set_context(self, serializer_field):
375
- """
376
- This hook is called by the serializer instance,
377
- prior to the validation call being made.
378
- """
379
- # Determine the existing instance, if this is an update operation.
380
- self.serializer_field = serializer_field
381
- self.instance = getattr(serializer_field.parent, "instance", None)
382
-
383
- def __call__(self, new_value):
361
+ def __call__(self, new_value, serializer_field):
362
+ instance = getattr(serializer_field.parent, "instance", None)
384
363
  # no instance -> it's not an update
385
- if not self.instance:
364
+ if not instance:
386
365
  return
387
366
 
388
- current_value = getattr(self.instance, self.serializer_field.field_name)
367
+ current_value = getattr(instance, serializer_field.field_name)
389
368
 
390
369
  if new_value != current_value:
391
370
  raise serializers.ValidationError(self.message, code=self.code)
@@ -1 +0,0 @@
1
- __version__ = "1.12.2"