udata 9.1.2.dev30355__py2.py3-none-any.whl → 9.1.2.dev30454__py2.py3-none-any.whl

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.

Potentially problematic release.


This version of udata might be problematic. Click here for more details.

Files changed (413) hide show
  1. tasks/__init__.py +109 -107
  2. tasks/helpers.py +18 -18
  3. udata/__init__.py +4 -4
  4. udata/admin/views.py +5 -5
  5. udata/api/__init__.py +111 -134
  6. udata/api/commands.py +45 -37
  7. udata/api/errors.py +5 -4
  8. udata/api/fields.py +23 -21
  9. udata/api/oauth2.py +55 -74
  10. udata/api/parsers.py +15 -15
  11. udata/api/signals.py +1 -1
  12. udata/api_fields.py +137 -89
  13. udata/app.py +58 -55
  14. udata/assets.py +5 -5
  15. udata/auth/__init__.py +37 -26
  16. udata/auth/forms.py +23 -15
  17. udata/auth/helpers.py +1 -1
  18. udata/auth/mails.py +3 -3
  19. udata/auth/password_validation.py +19 -15
  20. udata/auth/views.py +94 -68
  21. udata/commands/__init__.py +71 -69
  22. udata/commands/cache.py +7 -7
  23. udata/commands/db.py +201 -140
  24. udata/commands/dcat.py +36 -30
  25. udata/commands/fixtures.py +100 -84
  26. udata/commands/images.py +21 -20
  27. udata/commands/info.py +17 -20
  28. udata/commands/init.py +10 -10
  29. udata/commands/purge.py +12 -13
  30. udata/commands/serve.py +41 -29
  31. udata/commands/static.py +16 -18
  32. udata/commands/test.py +20 -20
  33. udata/commands/tests/fixtures.py +26 -24
  34. udata/commands/worker.py +31 -33
  35. udata/core/__init__.py +12 -12
  36. udata/core/activity/__init__.py +0 -1
  37. udata/core/activity/api.py +59 -49
  38. udata/core/activity/models.py +28 -26
  39. udata/core/activity/signals.py +1 -1
  40. udata/core/activity/tasks.py +16 -10
  41. udata/core/badges/api.py +6 -6
  42. udata/core/badges/commands.py +14 -13
  43. udata/core/badges/fields.py +8 -5
  44. udata/core/badges/forms.py +7 -4
  45. udata/core/badges/models.py +16 -31
  46. udata/core/badges/permissions.py +1 -3
  47. udata/core/badges/signals.py +2 -2
  48. udata/core/badges/tasks.py +3 -2
  49. udata/core/badges/tests/test_commands.py +10 -10
  50. udata/core/badges/tests/test_model.py +24 -31
  51. udata/core/contact_point/api.py +19 -18
  52. udata/core/contact_point/api_fields.py +21 -14
  53. udata/core/contact_point/factories.py +2 -2
  54. udata/core/contact_point/forms.py +7 -6
  55. udata/core/contact_point/models.py +3 -5
  56. udata/core/dataservices/api.py +26 -21
  57. udata/core/dataservices/factories.py +13 -11
  58. udata/core/dataservices/models.py +35 -40
  59. udata/core/dataservices/permissions.py +4 -4
  60. udata/core/dataservices/rdf.py +40 -17
  61. udata/core/dataservices/tasks.py +4 -3
  62. udata/core/dataset/actions.py +10 -10
  63. udata/core/dataset/activities.py +21 -23
  64. udata/core/dataset/api.py +321 -298
  65. udata/core/dataset/api_fields.py +443 -271
  66. udata/core/dataset/apiv2.py +305 -229
  67. udata/core/dataset/commands.py +38 -36
  68. udata/core/dataset/constants.py +61 -54
  69. udata/core/dataset/csv.py +70 -74
  70. udata/core/dataset/events.py +39 -32
  71. udata/core/dataset/exceptions.py +8 -4
  72. udata/core/dataset/factories.py +57 -65
  73. udata/core/dataset/forms.py +87 -63
  74. udata/core/dataset/models.py +336 -280
  75. udata/core/dataset/permissions.py +9 -6
  76. udata/core/dataset/preview.py +15 -17
  77. udata/core/dataset/rdf.py +156 -122
  78. udata/core/dataset/search.py +92 -77
  79. udata/core/dataset/signals.py +1 -1
  80. udata/core/dataset/tasks.py +63 -54
  81. udata/core/discussions/actions.py +5 -5
  82. udata/core/discussions/api.py +124 -120
  83. udata/core/discussions/factories.py +2 -2
  84. udata/core/discussions/forms.py +9 -7
  85. udata/core/discussions/metrics.py +1 -3
  86. udata/core/discussions/models.py +25 -24
  87. udata/core/discussions/notifications.py +18 -14
  88. udata/core/discussions/permissions.py +3 -3
  89. udata/core/discussions/signals.py +4 -4
  90. udata/core/discussions/tasks.py +24 -28
  91. udata/core/followers/api.py +32 -33
  92. udata/core/followers/models.py +9 -9
  93. udata/core/followers/signals.py +3 -3
  94. udata/core/jobs/actions.py +7 -7
  95. udata/core/jobs/api.py +99 -92
  96. udata/core/jobs/commands.py +48 -49
  97. udata/core/jobs/forms.py +11 -11
  98. udata/core/jobs/models.py +6 -6
  99. udata/core/metrics/__init__.py +2 -2
  100. udata/core/metrics/commands.py +34 -30
  101. udata/core/metrics/models.py +2 -4
  102. udata/core/metrics/signals.py +1 -1
  103. udata/core/metrics/tasks.py +3 -3
  104. udata/core/organization/activities.py +12 -15
  105. udata/core/organization/api.py +167 -174
  106. udata/core/organization/api_fields.py +183 -124
  107. udata/core/organization/apiv2.py +32 -32
  108. udata/core/organization/commands.py +20 -22
  109. udata/core/organization/constants.py +11 -11
  110. udata/core/organization/csv.py +17 -15
  111. udata/core/organization/factories.py +8 -11
  112. udata/core/organization/forms.py +32 -26
  113. udata/core/organization/metrics.py +2 -1
  114. udata/core/organization/models.py +87 -67
  115. udata/core/organization/notifications.py +18 -14
  116. udata/core/organization/permissions.py +10 -11
  117. udata/core/organization/rdf.py +14 -14
  118. udata/core/organization/search.py +30 -28
  119. udata/core/organization/signals.py +7 -7
  120. udata/core/organization/tasks.py +42 -61
  121. udata/core/owned.py +38 -27
  122. udata/core/post/api.py +82 -81
  123. udata/core/post/constants.py +8 -5
  124. udata/core/post/factories.py +4 -4
  125. udata/core/post/forms.py +13 -14
  126. udata/core/post/models.py +20 -22
  127. udata/core/post/tests/test_api.py +30 -32
  128. udata/core/reports/api.py +8 -7
  129. udata/core/reports/constants.py +1 -3
  130. udata/core/reports/models.py +10 -10
  131. udata/core/reuse/activities.py +15 -19
  132. udata/core/reuse/api.py +123 -126
  133. udata/core/reuse/api_fields.py +120 -85
  134. udata/core/reuse/apiv2.py +11 -10
  135. udata/core/reuse/constants.py +23 -23
  136. udata/core/reuse/csv.py +18 -18
  137. udata/core/reuse/factories.py +5 -9
  138. udata/core/reuse/forms.py +24 -21
  139. udata/core/reuse/models.py +55 -51
  140. udata/core/reuse/permissions.py +2 -2
  141. udata/core/reuse/search.py +49 -46
  142. udata/core/reuse/signals.py +1 -1
  143. udata/core/reuse/tasks.py +4 -5
  144. udata/core/site/api.py +47 -50
  145. udata/core/site/factories.py +2 -2
  146. udata/core/site/forms.py +4 -5
  147. udata/core/site/models.py +94 -63
  148. udata/core/site/rdf.py +14 -14
  149. udata/core/spam/api.py +16 -9
  150. udata/core/spam/constants.py +4 -4
  151. udata/core/spam/fields.py +13 -7
  152. udata/core/spam/models.py +27 -20
  153. udata/core/spam/signals.py +1 -1
  154. udata/core/spam/tests/test_spam.py +6 -5
  155. udata/core/spatial/api.py +72 -80
  156. udata/core/spatial/api_fields.py +73 -58
  157. udata/core/spatial/commands.py +67 -64
  158. udata/core/spatial/constants.py +3 -3
  159. udata/core/spatial/factories.py +37 -54
  160. udata/core/spatial/forms.py +27 -26
  161. udata/core/spatial/geoids.py +17 -17
  162. udata/core/spatial/models.py +43 -47
  163. udata/core/spatial/tasks.py +2 -1
  164. udata/core/spatial/tests/test_api.py +115 -130
  165. udata/core/spatial/tests/test_fields.py +74 -77
  166. udata/core/spatial/tests/test_geoid.py +22 -22
  167. udata/core/spatial/tests/test_models.py +5 -7
  168. udata/core/spatial/translations.py +16 -16
  169. udata/core/storages/__init__.py +16 -18
  170. udata/core/storages/api.py +66 -64
  171. udata/core/storages/tasks.py +7 -7
  172. udata/core/storages/utils.py +15 -15
  173. udata/core/storages/views.py +5 -6
  174. udata/core/tags/api.py +17 -14
  175. udata/core/tags/csv.py +4 -4
  176. udata/core/tags/models.py +8 -5
  177. udata/core/tags/tasks.py +11 -13
  178. udata/core/tags/views.py +4 -4
  179. udata/core/topic/api.py +84 -73
  180. udata/core/topic/apiv2.py +157 -127
  181. udata/core/topic/factories.py +3 -4
  182. udata/core/topic/forms.py +12 -14
  183. udata/core/topic/models.py +14 -19
  184. udata/core/topic/parsers.py +26 -26
  185. udata/core/user/activities.py +30 -29
  186. udata/core/user/api.py +151 -152
  187. udata/core/user/api_fields.py +132 -100
  188. udata/core/user/apiv2.py +7 -7
  189. udata/core/user/commands.py +38 -38
  190. udata/core/user/factories.py +8 -9
  191. udata/core/user/forms.py +14 -11
  192. udata/core/user/metrics.py +2 -2
  193. udata/core/user/models.py +68 -69
  194. udata/core/user/permissions.py +4 -5
  195. udata/core/user/rdf.py +7 -8
  196. udata/core/user/tasks.py +2 -2
  197. udata/core/user/tests/test_user_model.py +24 -16
  198. udata/cors.py +99 -0
  199. udata/db/tasks.py +2 -1
  200. udata/entrypoints.py +35 -31
  201. udata/errors.py +2 -1
  202. udata/event/values.py +6 -6
  203. udata/factories.py +2 -2
  204. udata/features/identicon/api.py +5 -6
  205. udata/features/identicon/backends.py +48 -55
  206. udata/features/identicon/tests/test_backends.py +4 -5
  207. udata/features/notifications/__init__.py +0 -1
  208. udata/features/notifications/actions.py +9 -9
  209. udata/features/notifications/api.py +17 -13
  210. udata/features/territories/__init__.py +12 -10
  211. udata/features/territories/api.py +14 -15
  212. udata/features/territories/models.py +23 -28
  213. udata/features/transfer/actions.py +8 -11
  214. udata/features/transfer/api.py +84 -77
  215. udata/features/transfer/factories.py +2 -1
  216. udata/features/transfer/models.py +11 -12
  217. udata/features/transfer/notifications.py +19 -15
  218. udata/features/transfer/permissions.py +5 -5
  219. udata/forms/__init__.py +5 -2
  220. udata/forms/fields.py +164 -172
  221. udata/forms/validators.py +19 -22
  222. udata/forms/widgets.py +9 -13
  223. udata/frontend/__init__.py +31 -26
  224. udata/frontend/csv.py +68 -58
  225. udata/frontend/markdown.py +40 -44
  226. udata/harvest/actions.py +89 -77
  227. udata/harvest/api.py +294 -238
  228. udata/harvest/backends/__init__.py +4 -4
  229. udata/harvest/backends/base.py +128 -111
  230. udata/harvest/backends/dcat.py +80 -66
  231. udata/harvest/commands.py +56 -60
  232. udata/harvest/csv.py +8 -8
  233. udata/harvest/exceptions.py +6 -3
  234. udata/harvest/filters.py +24 -23
  235. udata/harvest/forms.py +27 -28
  236. udata/harvest/models.py +88 -80
  237. udata/harvest/notifications.py +15 -10
  238. udata/harvest/signals.py +13 -13
  239. udata/harvest/tasks.py +11 -10
  240. udata/harvest/tests/factories.py +23 -24
  241. udata/harvest/tests/test_actions.py +136 -166
  242. udata/harvest/tests/test_api.py +220 -214
  243. udata/harvest/tests/test_base_backend.py +117 -112
  244. udata/harvest/tests/test_dcat_backend.py +380 -308
  245. udata/harvest/tests/test_filters.py +33 -22
  246. udata/harvest/tests/test_models.py +11 -14
  247. udata/harvest/tests/test_notifications.py +6 -7
  248. udata/harvest/tests/test_tasks.py +7 -6
  249. udata/i18n.py +237 -78
  250. udata/linkchecker/backends.py +5 -11
  251. udata/linkchecker/checker.py +23 -22
  252. udata/linkchecker/commands.py +4 -6
  253. udata/linkchecker/models.py +6 -6
  254. udata/linkchecker/tasks.py +18 -20
  255. udata/mail.py +21 -21
  256. udata/migrations/2020-07-24-remove-s-from-scope-oauth.py +9 -8
  257. udata/migrations/2020-08-24-add-fs-filename.py +9 -8
  258. udata/migrations/2020-09-28-update-reuses-datasets-metrics.py +5 -4
  259. udata/migrations/2020-10-16-migrate-ods-resources.py +9 -10
  260. udata/migrations/2021-04-08-update-schema-with-new-structure.py +8 -7
  261. udata/migrations/2021-05-27-fix-default-schema-name.py +7 -6
  262. udata/migrations/2021-07-05-remove-unused-badges.py +17 -15
  263. udata/migrations/2021-07-07-update-schema-for-community-resources.py +7 -6
  264. udata/migrations/2021-08-17-follow-integrity.py +5 -4
  265. udata/migrations/2021-08-17-harvest-integrity.py +13 -12
  266. udata/migrations/2021-08-17-oauth2client-integrity.py +5 -4
  267. udata/migrations/2021-08-17-transfer-integrity.py +5 -4
  268. udata/migrations/2021-08-17-users-integrity.py +9 -8
  269. udata/migrations/2021-12-14-reuse-topics.py +7 -6
  270. udata/migrations/2022-04-21-improve-extension-detection.py +8 -7
  271. udata/migrations/2022-09-22-clean-inactive-harvest-datasets.py +16 -14
  272. udata/migrations/2022-10-10-add-fs_uniquifier-to-user-model.py +6 -6
  273. udata/migrations/2022-10-10-migrate-harvest-extras.py +36 -26
  274. udata/migrations/2023-02-08-rename-internal-dates.py +46 -28
  275. udata/migrations/2024-01-29-fix-reuse-and-dataset-with-private-None.py +10 -8
  276. udata/migrations/2024-03-22-migrate-activity-kwargs-to-extras.py +6 -4
  277. udata/migrations/2024-06-11-fix-reuse-datasets-references.py +7 -6
  278. udata/migrations/__init__.py +123 -105
  279. udata/models/__init__.py +4 -4
  280. udata/mongo/__init__.py +13 -11
  281. udata/mongo/badges_field.py +3 -2
  282. udata/mongo/datetime_fields.py +13 -12
  283. udata/mongo/document.py +17 -16
  284. udata/mongo/engine.py +15 -16
  285. udata/mongo/errors.py +2 -1
  286. udata/mongo/extras_fields.py +30 -20
  287. udata/mongo/queryset.py +12 -12
  288. udata/mongo/slug_fields.py +38 -28
  289. udata/mongo/taglist_field.py +1 -2
  290. udata/mongo/url_field.py +5 -5
  291. udata/mongo/uuid_fields.py +4 -3
  292. udata/notifications/__init__.py +1 -1
  293. udata/notifications/mattermost.py +10 -9
  294. udata/rdf.py +167 -188
  295. udata/routing.py +40 -45
  296. udata/search/__init__.py +18 -19
  297. udata/search/adapter.py +17 -16
  298. udata/search/commands.py +44 -51
  299. udata/search/fields.py +13 -20
  300. udata/search/query.py +23 -18
  301. udata/search/result.py +9 -10
  302. udata/sentry.py +21 -19
  303. udata/settings.py +262 -198
  304. udata/sitemap.py +8 -6
  305. udata/storage/s3.py +20 -13
  306. udata/tags.py +4 -5
  307. udata/tasks.py +43 -42
  308. udata/tests/__init__.py +9 -6
  309. udata/tests/api/__init__.py +8 -6
  310. udata/tests/api/test_auth_api.py +395 -321
  311. udata/tests/api/test_base_api.py +33 -35
  312. udata/tests/api/test_contact_points.py +7 -9
  313. udata/tests/api/test_dataservices_api.py +211 -158
  314. udata/tests/api/test_datasets_api.py +823 -812
  315. udata/tests/api/test_follow_api.py +13 -15
  316. udata/tests/api/test_me_api.py +95 -112
  317. udata/tests/api/test_organizations_api.py +301 -339
  318. udata/tests/api/test_reports_api.py +35 -25
  319. udata/tests/api/test_reuses_api.py +134 -139
  320. udata/tests/api/test_swagger.py +5 -5
  321. udata/tests/api/test_tags_api.py +18 -25
  322. udata/tests/api/test_topics_api.py +94 -94
  323. udata/tests/api/test_transfer_api.py +53 -48
  324. udata/tests/api/test_user_api.py +128 -141
  325. udata/tests/apiv2/test_datasets.py +290 -198
  326. udata/tests/apiv2/test_me_api.py +10 -11
  327. udata/tests/apiv2/test_organizations.py +56 -74
  328. udata/tests/apiv2/test_swagger.py +5 -5
  329. udata/tests/apiv2/test_topics.py +69 -87
  330. udata/tests/cli/test_cli_base.py +8 -8
  331. udata/tests/cli/test_db_cli.py +21 -19
  332. udata/tests/dataservice/test_dataservice_tasks.py +8 -12
  333. udata/tests/dataset/test_csv_adapter.py +44 -35
  334. udata/tests/dataset/test_dataset_actions.py +2 -3
  335. udata/tests/dataset/test_dataset_commands.py +7 -8
  336. udata/tests/dataset/test_dataset_events.py +36 -29
  337. udata/tests/dataset/test_dataset_model.py +224 -217
  338. udata/tests/dataset/test_dataset_rdf.py +142 -131
  339. udata/tests/dataset/test_dataset_tasks.py +15 -15
  340. udata/tests/dataset/test_resource_preview.py +10 -13
  341. udata/tests/features/territories/__init__.py +9 -13
  342. udata/tests/features/territories/test_territories_api.py +71 -91
  343. udata/tests/forms/test_basic_fields.py +7 -7
  344. udata/tests/forms/test_current_user_field.py +39 -66
  345. udata/tests/forms/test_daterange_field.py +31 -39
  346. udata/tests/forms/test_dict_field.py +28 -26
  347. udata/tests/forms/test_extras_fields.py +102 -76
  348. udata/tests/forms/test_form_field.py +8 -8
  349. udata/tests/forms/test_image_field.py +33 -26
  350. udata/tests/forms/test_model_field.py +134 -123
  351. udata/tests/forms/test_model_list_field.py +7 -7
  352. udata/tests/forms/test_nested_model_list_field.py +117 -79
  353. udata/tests/forms/test_publish_as_field.py +36 -65
  354. udata/tests/forms/test_reference_field.py +34 -53
  355. udata/tests/forms/test_user_forms.py +23 -21
  356. udata/tests/forms/test_uuid_field.py +6 -10
  357. udata/tests/frontend/__init__.py +9 -6
  358. udata/tests/frontend/test_auth.py +7 -6
  359. udata/tests/frontend/test_csv.py +81 -96
  360. udata/tests/frontend/test_hooks.py +43 -43
  361. udata/tests/frontend/test_markdown.py +211 -191
  362. udata/tests/helpers.py +32 -37
  363. udata/tests/models.py +2 -2
  364. udata/tests/organization/test_csv_adapter.py +21 -16
  365. udata/tests/organization/test_notifications.py +11 -18
  366. udata/tests/organization/test_organization_model.py +13 -13
  367. udata/tests/organization/test_organization_rdf.py +29 -22
  368. udata/tests/organization/test_organization_tasks.py +16 -17
  369. udata/tests/plugin.py +79 -73
  370. udata/tests/reuse/test_reuse_model.py +21 -21
  371. udata/tests/reuse/test_reuse_task.py +11 -13
  372. udata/tests/search/__init__.py +11 -12
  373. udata/tests/search/test_adapter.py +60 -70
  374. udata/tests/search/test_query.py +16 -16
  375. udata/tests/search/test_results.py +10 -7
  376. udata/tests/site/test_site_api.py +11 -16
  377. udata/tests/site/test_site_metrics.py +20 -30
  378. udata/tests/site/test_site_model.py +4 -5
  379. udata/tests/site/test_site_rdf.py +94 -78
  380. udata/tests/test_activity.py +17 -17
  381. udata/tests/test_cors.py +62 -0
  382. udata/tests/test_discussions.py +292 -299
  383. udata/tests/test_i18n.py +37 -40
  384. udata/tests/test_linkchecker.py +91 -85
  385. udata/tests/test_mail.py +13 -17
  386. udata/tests/test_migrations.py +219 -180
  387. udata/tests/test_model.py +164 -157
  388. udata/tests/test_notifications.py +17 -17
  389. udata/tests/test_owned.py +14 -14
  390. udata/tests/test_rdf.py +25 -23
  391. udata/tests/test_routing.py +89 -93
  392. udata/tests/test_storages.py +137 -128
  393. udata/tests/test_tags.py +44 -46
  394. udata/tests/test_topics.py +7 -7
  395. udata/tests/test_transfer.py +42 -49
  396. udata/tests/test_uris.py +160 -161
  397. udata/tests/test_utils.py +79 -71
  398. udata/tests/user/test_user_rdf.py +5 -9
  399. udata/tests/workers/test_jobs_commands.py +57 -58
  400. udata/tests/workers/test_tasks_routing.py +23 -29
  401. udata/tests/workers/test_workers_api.py +125 -131
  402. udata/tests/workers/test_workers_helpers.py +6 -6
  403. udata/tracking.py +4 -6
  404. udata/uris.py +45 -46
  405. udata/utils.py +68 -66
  406. udata/wsgi.py +1 -1
  407. {udata-9.1.2.dev30355.dist-info → udata-9.1.2.dev30454.dist-info}/METADATA +7 -3
  408. udata-9.1.2.dev30454.dist-info/RECORD +706 -0
  409. udata-9.1.2.dev30355.dist-info/RECORD +0 -704
  410. {udata-9.1.2.dev30355.dist-info → udata-9.1.2.dev30454.dist-info}/LICENSE +0 -0
  411. {udata-9.1.2.dev30355.dist-info → udata-9.1.2.dev30454.dist-info}/WHEEL +0 -0
  412. {udata-9.1.2.dev30355.dist-info → udata-9.1.2.dev30454.dist-info}/entry_points.txt +0 -0
  413. {udata-9.1.2.dev30355.dist-info → udata-9.1.2.dev30454.dist-info}/top_level.txt +0 -0
udata/settings.py CHANGED
@@ -1,11 +1,9 @@
1
1
  import pkg_resources
2
-
3
2
  from kombu import Exchange, Queue
4
3
  from tlds import tld_set
5
4
 
6
5
  from udata.i18n import lazy_gettext as _
7
6
 
8
-
9
7
  HOUR = 60 * 60
10
8
 
11
9
 
@@ -14,19 +12,19 @@ class Defaults(object):
14
12
  TESTING = False
15
13
  SEND_MAIL = True
16
14
  LANGUAGES = {
17
- 'en': 'English',
18
- 'fr': 'Français',
19
- 'es': 'Español',
20
- 'pt': 'Português',
21
- 'sr': 'Српски',
22
- 'de': 'Deutsch',
15
+ "en": "English",
16
+ "fr": "Français",
17
+ "es": "Español",
18
+ "pt": "Português",
19
+ "sr": "Српски",
20
+ "de": "Deutsch",
23
21
  }
24
- DEFAULT_LANGUAGE = 'en'
25
- SECRET_KEY = 'Default uData secret key'
26
- CONTACT_EMAIL = 'contact@example.org'
27
- TERRITORIES_EMAIL = 'territories@example.org'
22
+ DEFAULT_LANGUAGE = "en"
23
+ SECRET_KEY = "Default uData secret key"
24
+ CONTACT_EMAIL = "contact@example.org"
25
+ TERRITORIES_EMAIL = "territories@example.org"
28
26
 
29
- MONGODB_HOST = 'mongodb://localhost:27017/udata'
27
+ MONGODB_HOST = "mongodb://localhost:27017/udata"
30
28
  MONGODB_CONNECT = False # Lazy connexion for Fork-safe usage
31
29
 
32
30
  # Search service configuration
@@ -34,43 +32,43 @@ class Defaults(object):
34
32
  SEARCH_SERVICE_REQUEST_TIMEOUT = 20
35
33
 
36
34
  # BROKER_TRANSPORT = 'redis'
37
- CELERY_BROKER_URL = 'redis://localhost:6379'
35
+ CELERY_BROKER_URL = "redis://localhost:6379"
38
36
  CELERY_BROKER_TRANSPORT_OPTIONS = {
39
- 'fanout_prefix': True,
40
- 'fanout_patterns': True,
37
+ "fanout_prefix": True,
38
+ "fanout_patterns": True,
41
39
  }
42
- CELERY_RESULT_BACKEND = 'redis://localhost:6379'
40
+ CELERY_RESULT_BACKEND = "redis://localhost:6379"
43
41
  CELERY_RESULT_EXPIRES = 6 * HOUR # Results are kept 6 hours
44
42
  CELERY_TASK_IGNORE_RESULT = True
45
- CELERY_TASK_SERIALIZER = 'pickle'
46
- CELERY_RESULT_SERIALIZER = 'pickle'
47
- CELERY_ACCEPT_CONTENT = ['pickle', 'json']
43
+ CELERY_TASK_SERIALIZER = "pickle"
44
+ CELERY_RESULT_SERIALIZER = "pickle"
45
+ CELERY_ACCEPT_CONTENT = ["pickle", "json"]
48
46
  CELERY_WORKER_HIJACK_ROOT_LOGGER = False
49
- CELERY_BEAT_SCHEDULER = 'udata.tasks.Scheduler'
47
+ CELERY_BEAT_SCHEDULER = "udata.tasks.Scheduler"
50
48
  CELERY_MONGODB_SCHEDULER_COLLECTION = "schedules"
51
49
  CELERY_MONGODB_SCHEDULER_CONNECTION_ALIAS = "udata_scheduler"
52
50
 
53
51
  # Default celery routing
54
- CELERY_TASK_DEFAULT_QUEUE = 'default'
52
+ CELERY_TASK_DEFAULT_QUEUE = "default"
55
53
  CELERY_TASK_QUEUES = (
56
54
  # Default queue (on default exchange)
57
- Queue('default', routing_key='task.#'),
55
+ Queue("default", routing_key="task.#"),
58
56
  # High priority for urgent tasks
59
- Queue('high', Exchange('high', type='topic'), routing_key='high.#'),
57
+ Queue("high", Exchange("high", type="topic"), routing_key="high.#"),
60
58
  # Low priority for slow tasks
61
- Queue('low', Exchange('low', type='topic'), routing_key='low.#'),
59
+ Queue("low", Exchange("low", type="topic"), routing_key="low.#"),
62
60
  )
63
- CELERY_TASK_DEFAULT_EXCHANGE = 'default'
64
- CELERY_TASK_DEFAULT_EXCHANGE_TYPE = 'topic'
65
- CELERY_TASK_DEFAULT_ROUTING_KEY = 'task.default'
66
- CELERY_TASK_ROUTES = 'udata.tasks.router'
61
+ CELERY_TASK_DEFAULT_EXCHANGE = "default"
62
+ CELERY_TASK_DEFAULT_EXCHANGE_TYPE = "topic"
63
+ CELERY_TASK_DEFAULT_ROUTING_KEY = "task.default"
64
+ CELERY_TASK_ROUTES = "udata.tasks.router"
67
65
 
68
- CACHE_KEY_PREFIX = 'udata-cache'
69
- CACHE_TYPE = 'flask_caching.backends.redis'
66
+ CACHE_KEY_PREFIX = "udata-cache"
67
+ CACHE_TYPE = "flask_caching.backends.redis"
70
68
 
71
69
  # Flask mail settings
72
70
 
73
- MAIL_DEFAULT_SENDER = 'webmaster@udata'
71
+ MAIL_DEFAULT_SENDER = "webmaster@udata"
74
72
 
75
73
  # Flask security settings
76
74
 
@@ -85,40 +83,39 @@ class Defaults(object):
85
83
  SECURITY_RECOVERABLE = True
86
84
  SECURITY_CHANGEABLE = True
87
85
 
88
- SECURITY_PASSWORD_HASH = 'bcrypt'
89
- SECURITY_PASSWORD_NORMALIZE_FORM = 'NFKD'
86
+ SECURITY_PASSWORD_HASH = "bcrypt"
87
+ SECURITY_PASSWORD_NORMALIZE_FORM = "NFKD"
90
88
  SECURITY_PASSWORD_LENGTH_MIN = 8
91
89
  SECURITY_PASSWORD_REQUIREMENTS_LOWERCASE = True
92
90
  SECURITY_PASSWORD_REQUIREMENTS_DIGITS = True
93
91
  SECURITY_PASSWORD_REQUIREMENTS_UPPERCASE = True
94
92
  SECURITY_PASSWORD_REQUIREMENTS_SYMBOLS = False
95
93
 
96
- SECURITY_PASSWORD_SALT = 'Default uData secret password salt'
97
- SECURITY_CONFIRM_SALT = 'Default uData secret confirm salt'
98
- SECURITY_RESET_SALT = 'Default uData secret reset salt'
99
- SECURITY_REMEMBER_SALT = 'Default uData remember salt'
94
+ SECURITY_PASSWORD_SALT = "Default uData secret password salt"
95
+ SECURITY_CONFIRM_SALT = "Default uData secret confirm salt"
96
+ SECURITY_RESET_SALT = "Default uData secret reset salt"
97
+ SECURITY_REMEMBER_SALT = "Default uData remember salt"
100
98
 
101
99
  SECURITY_EMAIL_SENDER = MAIL_DEFAULT_SENDER
102
100
 
103
- SECURITY_EMAIL_SUBJECT_REGISTER = _('Welcome')
104
- SECURITY_EMAIL_SUBJECT_CONFIRM = _('Please confirm your email')
105
- SECURITY_EMAIL_SUBJECT_PASSWORDLESS = _('Login instructions')
106
- SECURITY_EMAIL_SUBJECT_PASSWORD_NOTICE = _('Your password has been reset')
107
- SECURITY_EMAIL_SUBJECT_PASSWORD_CHANGE_NOTICE = _(
108
- 'Your password has been changed')
109
- SECURITY_EMAIL_SUBJECT_PASSWORD_RESET = _('Password reset instructions')
101
+ SECURITY_EMAIL_SUBJECT_REGISTER = _("Welcome")
102
+ SECURITY_EMAIL_SUBJECT_CONFIRM = _("Please confirm your email")
103
+ SECURITY_EMAIL_SUBJECT_PASSWORDLESS = _("Login instructions")
104
+ SECURITY_EMAIL_SUBJECT_PASSWORD_NOTICE = _("Your password has been reset")
105
+ SECURITY_EMAIL_SUBJECT_PASSWORD_CHANGE_NOTICE = _("Your password has been changed")
106
+ SECURITY_EMAIL_SUBJECT_PASSWORD_RESET = _("Password reset instructions")
110
107
 
111
108
  SECURITY_RETURN_GENERIC_RESPONSES = False
112
109
 
113
110
  # Sentry configuration
114
111
  SENTRY_DSN = None
115
112
  SENTRY_TAGS = {}
116
- SENTRY_USER_ATTRS = ['slug', 'email', 'fullname']
117
- SENTRY_LOGGING = 'WARNING'
113
+ SENTRY_USER_ATTRS = ["slug", "email", "fullname"]
114
+ SENTRY_LOGGING = "WARNING"
118
115
  SENTRY_IGNORE_EXCEPTIONS = []
119
116
 
120
117
  # Flask WTF settings
121
- CSRF_SESSION_KEY = 'Default uData csrf key'
118
+ CSRF_SESSION_KEY = "Default uData csrf key"
122
119
 
123
120
  # Flask-Sitemap settings
124
121
  # TODO: chose between explicit or automagic for params-less endpoints
@@ -127,15 +124,15 @@ class Defaults(object):
127
124
 
128
125
  AUTO_INDEX = True
129
126
 
130
- SITE_ID = 'default'
131
- SITE_TITLE = 'uData'
132
- SITE_KEYWORDS = ['opendata', 'udata']
127
+ SITE_ID = "default"
128
+ SITE_TITLE = "uData"
129
+ SITE_KEYWORDS = ["opendata", "udata"]
133
130
  SITE_AUTHOR_URL = None
134
- SITE_AUTHOR = 'Udata'
135
- SITE_GITHUB_URL = 'https://github.com/opendatateam/udata'
136
- SITE_TERMS_LOCATION = pkg_resources.resource_filename(__name__, 'terms.md')
131
+ SITE_AUTHOR = "Udata"
132
+ SITE_GITHUB_URL = "https://github.com/etalab/udata"
133
+ SITE_TERMS_LOCATION = pkg_resources.resource_filename(__name__, "terms.md")
137
134
 
138
- UDATA_INSTANCE_NAME = 'udata'
135
+ UDATA_INSTANCE_NAME = "udata"
139
136
 
140
137
  PLUGINS = []
141
138
  THEME = None
@@ -143,85 +140,85 @@ class Defaults(object):
143
140
  STATIC_DIRS = []
144
141
 
145
142
  # OAuth 2 settings
146
- OAUTH2_PROVIDER_ERROR_ENDPOINT = 'oauth.oauth_error'
143
+ OAUTH2_PROVIDER_ERROR_ENDPOINT = "oauth.oauth_error"
147
144
  OAUTH2_REFRESH_TOKEN_GENERATOR = True
148
145
  OAUTH2_TOKEN_EXPIRES_IN = {
149
- 'authorization_code': 30 * 24 * HOUR,
150
- 'implicit': 10 * 24 * HOUR,
151
- 'password': 30 * 24 * HOUR,
152
- 'client_credentials': 30 * 24 * HOUR
146
+ "authorization_code": 30 * 24 * HOUR,
147
+ "implicit": 10 * 24 * HOUR,
148
+ "password": 30 * 24 * HOUR,
149
+ "client_credentials": 30 * 24 * HOUR,
153
150
  }
154
151
  OAUTH2_ALLOW_WILDCARD_IN_REDIRECT_URI = False
155
152
 
156
153
  MD_ALLOWED_TAGS = [
157
- 'a',
158
- 'abbr',
159
- 'acronym',
160
- 'b',
161
- 'br',
162
- 'blockquote',
163
- 'code',
164
- 'dd',
165
- 'del',
166
- 'div',
167
- 'dl',
168
- 'dt',
169
- 'em',
170
- 'h1',
171
- 'h2',
172
- 'h3',
173
- 'h4',
174
- 'h5',
175
- 'h6',
176
- 'hr',
177
- 'i',
178
- 'img',
179
- 'li',
180
- 'ol',
181
- 'p',
182
- 'pre',
183
- 'small',
184
- 'span',
185
- 'strong',
186
- 'ul',
187
- 'sup',
188
- 'sub',
189
- 'table',
190
- 'td',
191
- 'th',
192
- 'tr',
193
- 'tbody',
194
- 'thead',
195
- 'tfooter',
196
- 'details',
197
- 'summary'
154
+ "a",
155
+ "abbr",
156
+ "acronym",
157
+ "b",
158
+ "br",
159
+ "blockquote",
160
+ "code",
161
+ "dd",
162
+ "del",
163
+ "div",
164
+ "dl",
165
+ "dt",
166
+ "em",
167
+ "h1",
168
+ "h2",
169
+ "h3",
170
+ "h4",
171
+ "h5",
172
+ "h6",
173
+ "hr",
174
+ "i",
175
+ "img",
176
+ "li",
177
+ "ol",
178
+ "p",
179
+ "pre",
180
+ "small",
181
+ "span",
182
+ "strong",
183
+ "ul",
184
+ "sup",
185
+ "sub",
186
+ "table",
187
+ "td",
188
+ "th",
189
+ "tr",
190
+ "tbody",
191
+ "thead",
192
+ "tfooter",
193
+ "details",
194
+ "summary",
198
195
  # 'title',
199
196
  ]
200
197
 
201
198
  MD_ALLOWED_ATTRIBUTES = {
202
- 'a': ['href', 'title', 'rel', 'data-tooltip'],
203
- 'abbr': ['title'],
204
- 'acronym': ['title'],
205
- 'div': ['class'],
206
- 'img': ['alt', 'src', 'title']
199
+ "a": ["href", "title", "rel", "data-tooltip"],
200
+ "abbr": ["title"],
201
+ "acronym": ["title"],
202
+ "div": ["class"],
203
+ "img": ["alt", "src", "title"],
207
204
  }
208
205
 
209
206
  MD_ALLOWED_STYLES = []
210
207
 
211
208
  # Extracted from https://github.github.com/gfm/#disallowed-raw-html-extension-
212
209
  MD_FILTERED_TAGS = [
213
- 'title',
214
- 'textarea',
215
- 'style',
216
- 'xmp',
217
- 'iframe',
218
- 'noembed',
219
- 'noframes',
220
- 'script',
221
- 'plaintext',
210
+ "title",
211
+ "textarea",
212
+ "style",
213
+ "xmp",
214
+ "iframe",
215
+ "noembed",
216
+ "noframes",
217
+ "script",
218
+ "plaintext",
222
219
  ]
223
220
 
224
- MD_ALLOWED_PROTOCOLS = ['http', 'https', 'ftp', 'ftps']
221
+ MD_ALLOWED_PROTOCOLS = ["http", "https", "ftp", "ftps"]
225
222
 
226
223
  # Tags constraints
227
224
  TAG_MIN_LENGTH = 3
@@ -232,7 +229,7 @@ class Defaults(object):
232
229
  # A list of tuples, each tuple describing a group with its title and
233
230
  # a list of licenses associated. Translations are not supported.
234
231
  # Example:
235
- # LICENSE_GROUPS = [
232
+ # LICENSE_GROUPS = [
236
233
  # ("Autorités administratives", [
237
234
  # {"value": "lov2", "recommended": True, "description": "Recommandée", "code": "etalab-2.0"},
238
235
  # {"value": "notspecified", "description": "Le Code des relations entre le public et l’administration ne s’applique pas"}]),
@@ -256,7 +253,7 @@ class Defaults(object):
256
253
  HARVEST_MAX_ITEMS = None
257
254
 
258
255
  # Harvesters are scheduled at midnight by default
259
- HARVEST_DEFAULT_SCHEDULE = '0 0 * * *'
256
+ HARVEST_DEFAULT_SCHEDULE = "0 0 * * *"
260
257
 
261
258
  # The number of days of harvest jobs to keep (ie. number of days of history kept)
262
259
  HARVEST_JOBS_RETENTION_DAYS = 365
@@ -266,9 +263,9 @@ class Defaults(object):
266
263
 
267
264
  HARVEST_VALIDATION_CONTACT_FORM = None
268
265
 
269
- HARVEST_MAX_CATALOG_SIZE_IN_MONGO = None # Defaults to the size of a MongoDB document
270
- HARVEST_GRAPHS_S3_BUCKET = None # If the catalog is bigger than `HARVEST_MAX_CATALOG_SIZE_IN_MONGO` store the graph inside S3 instead of MongoDB
271
- HARVEST_GRAPHS_S3_FILENAME_PREFIX = '' # Useful to store the graphs inside a subfolder of the bucket. For example by setting `HARVEST_GRAPHS_S3_FILENAME_PREFIX = 'graphs/'`
266
+ HARVEST_MAX_CATALOG_SIZE_IN_MONGO = None # Defaults to the size of a MongoDB document
267
+ HARVEST_GRAPHS_S3_BUCKET = None # If the catalog is bigger than `HARVEST_MAX_CATALOG_SIZE_IN_MONGO` store the graph inside S3 instead of MongoDB
268
+ HARVEST_GRAPHS_S3_FILENAME_PREFIX = "" # Useful to store the graphs inside a subfolder of the bucket. For example by setting `HARVEST_GRAPHS_S3_FILENAME_PREFIX = 'graphs/'`
272
269
 
273
270
  # S3 connection details
274
271
  S3_URL = None
@@ -284,20 +281,20 @@ class Defaults(object):
284
281
 
285
282
  LINKCHECKING_ENABLED = True
286
283
  # Resource types ignored by linkchecker
287
- LINKCHECKING_UNCHECKED_TYPES = ('api', )
284
+ LINKCHECKING_UNCHECKED_TYPES = ("api",)
288
285
  LINKCHECKING_IGNORE_DOMAINS = []
289
- LINKCHECKING_IGNORE_PATTERNS = ['format=shp']
286
+ LINKCHECKING_IGNORE_PATTERNS = ["format=shp"]
290
287
  LINKCHECKING_MIN_CACHE_DURATION = 60 # in minutes
291
288
  LINKCHECKING_MAX_CACHE_DURATION = 1080 # in minutes (1 week)
292
289
  LINKCHECKING_UNAVAILABLE_THRESHOLD = 100
293
- LINKCHECKING_DEFAULT_LINKCHECKER = 'no_check'
290
+ LINKCHECKING_DEFAULT_LINKCHECKER = "no_check"
294
291
 
295
292
  # Ignore some endpoint from API tracking
296
293
  # By default ignore the 3 most called APIs
297
294
  TRACKING_BLACKLIST = [
298
- 'api.notifications',
299
- 'api.check_dataset_resource',
300
- 'api.avatar',
295
+ "api.notifications",
296
+ "api.check_dataset_resource",
297
+ "api.avatar",
301
298
  ]
302
299
 
303
300
  DELETE_ME = True
@@ -309,56 +306,109 @@ class Defaults(object):
309
306
 
310
307
  ALLOWED_ARCHIVE_EXTENSIONS = [
311
308
  # Archives
312
- 'tar', 'gz', 'tgz', 'rar', 'zip', '7z', 'xz', 'bz2'
309
+ "tar",
310
+ "gz",
311
+ "tgz",
312
+ "rar",
313
+ "zip",
314
+ "7z",
315
+ "xz",
316
+ "bz2",
313
317
  ]
314
318
 
315
319
  ALLOWED_RESOURCES_EXTENSIONS = ALLOWED_ARCHIVE_EXTENSIONS + [
316
320
  # Base
317
- 'csv', 'txt', 'json', 'pdf', 'xml', 'rtf', 'xsd',
321
+ "csv",
322
+ "txt",
323
+ "json",
324
+ "pdf",
325
+ "xml",
326
+ "rtf",
327
+ "xsd",
318
328
  # OpenOffice
319
- 'ods', 'odt', 'odp', 'odg',
329
+ "ods",
330
+ "odt",
331
+ "odp",
332
+ "odg",
320
333
  # Microsoft Office
321
- 'xls', 'xlsx', 'doc', 'docx', 'pps', 'ppt',
334
+ "xls",
335
+ "xlsx",
336
+ "doc",
337
+ "docx",
338
+ "pps",
339
+ "ppt",
322
340
  # Images
323
- 'jpeg', 'jpg', 'jpe', 'gif', 'png', 'dwg', 'svg', 'tiff', 'ecw', 'svgz', 'jp2',
341
+ "jpeg",
342
+ "jpg",
343
+ "jpe",
344
+ "gif",
345
+ "png",
346
+ "dwg",
347
+ "svg",
348
+ "tiff",
349
+ "ecw",
350
+ "svgz",
351
+ "jp2",
324
352
  # Geo
325
- 'shp', 'kml', 'kmz', 'gpx', 'shx', 'ovr', 'geojson', 'gpkg',
353
+ "shp",
354
+ "kml",
355
+ "kmz",
356
+ "gpx",
357
+ "shx",
358
+ "ovr",
359
+ "geojson",
360
+ "gpkg",
326
361
  # Meteorology
327
- 'grib2',
362
+ "grib2",
328
363
  # RDF
329
- 'rdf', 'ttl', 'n3',
364
+ "rdf",
365
+ "ttl",
366
+ "n3",
330
367
  # Misc
331
- 'dbf', 'prj', 'sql', 'sqlite', 'db', 'epub', 'sbn', 'sbx', 'cpg', 'lyr', 'owl', 'dxf',
332
- 'ics', 'ssim', 'other'
368
+ "dbf",
369
+ "prj",
370
+ "sql",
371
+ "sqlite",
372
+ "db",
373
+ "epub",
374
+ "sbn",
375
+ "sbx",
376
+ "cpg",
377
+ "lyr",
378
+ "owl",
379
+ "dxf",
380
+ "ics",
381
+ "ssim",
382
+ "other",
333
383
  ]
334
384
 
335
385
  ALLOWED_RESOURCES_MIMES = [
336
- 'text/csv',
337
- 'application/json',
338
- 'application/pdf',
339
- 'application/msword',
340
- 'application/vnd',
341
- 'application/vnd.geo+json',
342
- 'application/zip',
343
- 'application/x-tar',
344
- 'application/x-bzip',
345
- 'application/x-bzip2',
346
- 'application/x-7z-compressed',
347
- 'application/x-rar-compressed',
348
- 'application/epub+zip',
349
- 'application/rtf',
350
- 'application/rdf+xml',
351
- 'application/xml',
352
- 'application/xhtml+xml',
353
- 'image/bmp',
354
- 'image/jpeg',
355
- 'image/png',
356
- 'image/svg+xml',
357
- 'text/html',
358
- 'text/calendar',
359
- 'text/plain',
360
- 'text/xml',
361
- 'text/turtle'
386
+ "text/csv",
387
+ "application/json",
388
+ "application/pdf",
389
+ "application/msword",
390
+ "application/vnd",
391
+ "application/vnd.geo+json",
392
+ "application/zip",
393
+ "application/x-tar",
394
+ "application/x-bzip",
395
+ "application/x-bzip2",
396
+ "application/x-7z-compressed",
397
+ "application/x-rar-compressed",
398
+ "application/epub+zip",
399
+ "application/rtf",
400
+ "application/rdf+xml",
401
+ "application/xml",
402
+ "application/xhtml+xml",
403
+ "image/bmp",
404
+ "image/jpeg",
405
+ "image/png",
406
+ "image/svg+xml",
407
+ "text/html",
408
+ "text/calendar",
409
+ "text/plain",
410
+ "text/xml",
411
+ "text/turtle",
362
412
  ]
363
413
 
364
414
  # How much time upload chunks are kept before cleanup
@@ -393,12 +443,12 @@ class Defaults(object):
393
443
  # Organization settings
394
444
  ###########################################################################
395
445
  # The business identification format to use for validation
396
- ORG_BID_FORMAT = 'siret'
446
+ ORG_BID_FORMAT = "siret"
397
447
 
398
448
  # Preview settings
399
449
  ###########################################################################
400
450
  # Preview mode can be either `iframe` or `page` or `None`
401
- PREVIEW_MODE = 'iframe'
451
+ PREVIEW_MODE = "iframe"
402
452
 
403
453
  # URLs validation settings
404
454
  ###########################################################################
@@ -409,7 +459,7 @@ class Defaults(object):
409
459
  # Whether or not to allow credentials in URLs submission.
410
460
  URLS_ALLOW_CREDENTIALS = True
411
461
  # List of allowed URL schemes.
412
- URLS_ALLOWED_SCHEMES = ('http', 'https', 'ftp', 'ftps')
462
+ URLS_ALLOWED_SCHEMES = ("http", "https", "ftp", "ftps")
413
463
  # List of allowed TLDs.
414
464
  URLS_ALLOWED_TLDS = tld_set
415
465
 
@@ -422,8 +472,15 @@ class Defaults(object):
422
472
 
423
473
  # Export CSVs of model objects as resources of a dataset
424
474
  ########################################################
425
- EXPORT_CSV_MODELS = ('dataset', 'resource', 'discussion', 'organization',
426
- 'reuse', 'tag', 'harvest')
475
+ EXPORT_CSV_MODELS = (
476
+ "dataset",
477
+ "resource",
478
+ "discussion",
479
+ "organization",
480
+ "reuse",
481
+ "tag",
482
+ "harvest",
483
+ )
427
484
  EXPORT_CSV_DATASET_ID = None
428
485
 
429
486
  # Autocomplete parameters
@@ -434,32 +491,36 @@ class Defaults(object):
434
491
  # Archive parameters
435
492
  ####################
436
493
  ARCHIVE_COMMENT_USER_ID = None
437
- ARCHIVE_COMMENT_TITLE = _('This dataset has been archived')
494
+ ARCHIVE_COMMENT_TITLE = _("This dataset has been archived")
438
495
 
439
496
  # Schemas parameters
440
497
  ####################
441
498
  SCHEMA_CATALOG_URL = None
442
499
 
443
- API_DOC_EXTERNAL_LINK = 'https://guides.data.gouv.fr/publier-des-donnees/guide-data.gouv.fr/api/reference'
500
+ API_DOC_EXTERNAL_LINK = (
501
+ "https://guides.data.gouv.fr/publier-des-donnees/guide-data.gouv.fr/api/reference"
502
+ )
444
503
 
445
504
  # Read Only Mode
446
505
  ####################
447
506
  # This mode can be used to mitigate a spam attack for example.
448
507
  # It disables the methods listed in the following block list.
449
508
  READ_ONLY_MODE = False
450
- METHOD_BLOCKLIST = ['OrganizationListAPI.post',
451
- 'ReuseListAPI.post',
452
- 'DatasetListAPI.post',
453
- 'CommunityResourcesAPI.post',
454
- 'UploadNewCommunityResources.post',
455
- 'DiscussionAPI.post',
456
- 'DiscussionsAPI.post',
457
- 'SourcesAPI.post',
458
- 'FollowAPI.post']
509
+ METHOD_BLOCKLIST = [
510
+ "OrganizationListAPI.post",
511
+ "ReuseListAPI.post",
512
+ "DatasetListAPI.post",
513
+ "CommunityResourcesAPI.post",
514
+ "UploadNewCommunityResources.post",
515
+ "DiscussionAPI.post",
516
+ "DiscussionsAPI.post",
517
+ "SourcesAPI.post",
518
+ "FollowAPI.post",
519
+ ]
459
520
 
460
521
  FIXTURE_DATASET_SLUGS = []
461
522
  PUBLISH_ON_RESOURCE_EVENTS = False
462
- RESOURCES_ANALYSER_URI = 'http://localhost:8000'
523
+ RESOURCES_ANALYSER_URI = "http://localhost:8000"
463
524
 
464
525
  # Datasets quality settings
465
526
  ###########################################################################
@@ -477,7 +538,8 @@ class Defaults(object):
477
538
 
478
539
 
479
540
  class Testing(object):
480
- '''Sane values for testing. Should be applied as override'''
541
+ """Sane values for testing. Should be applied as override"""
542
+
481
543
  TESTING = True
482
544
  # related to https://github.com/noirbizarre/flask-restplus/commit/93e412789f1ef8d1d2eab837f15535cf79bd144d#diff-68876137696247abc8c123622c73a11f # noqa
483
545
  # this keeps our legacy tests from failing, we should probably fix the tests instead someday
@@ -490,20 +552,22 @@ class Testing(object):
490
552
  TEST_WITH_PLUGINS = False
491
553
  PLUGINS = []
492
554
  TEST_WITH_THEME = False
493
- THEME = 'testing'
494
- CACHE_TYPE = 'flask_caching.backends.null'
555
+ THEME = "testing"
556
+ CACHE_TYPE = "flask_caching.backends.null"
495
557
  CACHE_NO_NULL_WARNING = True
496
558
  DEBUG_TOOLBAR = False
497
- SERVER_NAME = 'local.test'
498
- DEFAULT_LANGUAGE = 'fr'
559
+ SERVER_NAME = "local.test"
560
+ DEFAULT_LANGUAGE = "fr"
499
561
  ACTIVATE_TERRITORIES = False
500
- LOGGER_HANDLER_POLICY = 'never'
562
+ LOGGER_HANDLER_POLICY = "never"
501
563
  CELERYD_HIJACK_ROOT_LOGGER = False
502
564
  URLS_ALLOW_LOCAL = True # Test server URL is local.test
503
- URLS_ALLOWED_TLDS = tld_set | set(['test'])
565
+ URLS_ALLOWED_TLDS = tld_set | set(["test"])
504
566
  URLS_ALLOW_PRIVATE = False
505
567
  FS_IMAGES_OPTIMIZE = True
506
- SECURITY_EMAIL_VALIDATOR_ARGS = {"check_deliverability": False} # Disables deliverability for email domain name
568
+ SECURITY_EMAIL_VALIDATOR_ARGS = {
569
+ "check_deliverability": False
570
+ } # Disables deliverability for email domain name
507
571
  PUBLISH_ON_RESOURCE_EVENTS = False
508
572
 
509
573
 
@@ -512,15 +576,15 @@ class Debug(Defaults):
512
576
  SEND_MAIL = False
513
577
  DEBUG_TB_INTERCEPT_REDIRECTS = False
514
578
  DEBUG_TB_PANELS = (
515
- 'flask_debugtoolbar.panels.versions.VersionDebugPanel',
516
- 'flask_debugtoolbar.panels.timer.TimerDebugPanel',
517
- 'flask_debugtoolbar.panels.headers.HeaderDebugPanel',
518
- 'flask_debugtoolbar.panels.request_vars.RequestVarsDebugPanel',
519
- 'flask_debugtoolbar.panels.config_vars.ConfigVarsDebugPanel',
520
- 'flask_debugtoolbar.panels.template.TemplateDebugPanel',
521
- 'flask_debugtoolbar.panels.logger.LoggingPanel',
522
- 'flask_debugtoolbar.panels.profiler.ProfilerDebugPanel',
523
- 'flask_mongoengine.panels.MongoDebugPanel',
579
+ "flask_debugtoolbar.panels.versions.VersionDebugPanel",
580
+ "flask_debugtoolbar.panels.timer.TimerDebugPanel",
581
+ "flask_debugtoolbar.panels.headers.HeaderDebugPanel",
582
+ "flask_debugtoolbar.panels.request_vars.RequestVarsDebugPanel",
583
+ "flask_debugtoolbar.panels.config_vars.ConfigVarsDebugPanel",
584
+ "flask_debugtoolbar.panels.template.TemplateDebugPanel",
585
+ "flask_debugtoolbar.panels.logger.LoggingPanel",
586
+ "flask_debugtoolbar.panels.profiler.ProfilerDebugPanel",
587
+ "flask_mongoengine.panels.MongoDebugPanel",
524
588
  )
525
- CACHE_TYPE = 'flask_caching.backends.null'
589
+ CACHE_TYPE = "flask_caching.backends.null"
526
590
  CACHE_NO_NULL_WARNING = True