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.
- tasks/__init__.py +109 -107
- tasks/helpers.py +18 -18
- udata/__init__.py +4 -4
- udata/admin/views.py +5 -5
- udata/api/__init__.py +111 -134
- udata/api/commands.py +45 -37
- udata/api/errors.py +5 -4
- udata/api/fields.py +23 -21
- udata/api/oauth2.py +55 -74
- udata/api/parsers.py +15 -15
- udata/api/signals.py +1 -1
- udata/api_fields.py +137 -89
- udata/app.py +58 -55
- udata/assets.py +5 -5
- udata/auth/__init__.py +37 -26
- udata/auth/forms.py +23 -15
- udata/auth/helpers.py +1 -1
- udata/auth/mails.py +3 -3
- udata/auth/password_validation.py +19 -15
- udata/auth/views.py +94 -68
- udata/commands/__init__.py +71 -69
- udata/commands/cache.py +7 -7
- udata/commands/db.py +201 -140
- udata/commands/dcat.py +36 -30
- udata/commands/fixtures.py +100 -84
- udata/commands/images.py +21 -20
- udata/commands/info.py +17 -20
- udata/commands/init.py +10 -10
- udata/commands/purge.py +12 -13
- udata/commands/serve.py +41 -29
- udata/commands/static.py +16 -18
- udata/commands/test.py +20 -20
- udata/commands/tests/fixtures.py +26 -24
- udata/commands/worker.py +31 -33
- udata/core/__init__.py +12 -12
- udata/core/activity/__init__.py +0 -1
- udata/core/activity/api.py +59 -49
- udata/core/activity/models.py +28 -26
- udata/core/activity/signals.py +1 -1
- udata/core/activity/tasks.py +16 -10
- udata/core/badges/api.py +6 -6
- udata/core/badges/commands.py +14 -13
- udata/core/badges/fields.py +8 -5
- udata/core/badges/forms.py +7 -4
- udata/core/badges/models.py +16 -31
- udata/core/badges/permissions.py +1 -3
- udata/core/badges/signals.py +2 -2
- udata/core/badges/tasks.py +3 -2
- udata/core/badges/tests/test_commands.py +10 -10
- udata/core/badges/tests/test_model.py +24 -31
- udata/core/contact_point/api.py +19 -18
- udata/core/contact_point/api_fields.py +21 -14
- udata/core/contact_point/factories.py +2 -2
- udata/core/contact_point/forms.py +7 -6
- udata/core/contact_point/models.py +3 -5
- udata/core/dataservices/api.py +26 -21
- udata/core/dataservices/factories.py +13 -11
- udata/core/dataservices/models.py +35 -40
- udata/core/dataservices/permissions.py +4 -4
- udata/core/dataservices/rdf.py +40 -17
- udata/core/dataservices/tasks.py +4 -3
- udata/core/dataset/actions.py +10 -10
- udata/core/dataset/activities.py +21 -23
- udata/core/dataset/api.py +321 -298
- udata/core/dataset/api_fields.py +443 -271
- udata/core/dataset/apiv2.py +305 -229
- udata/core/dataset/commands.py +38 -36
- udata/core/dataset/constants.py +61 -54
- udata/core/dataset/csv.py +70 -74
- udata/core/dataset/events.py +39 -32
- udata/core/dataset/exceptions.py +8 -4
- udata/core/dataset/factories.py +57 -65
- udata/core/dataset/forms.py +87 -63
- udata/core/dataset/models.py +336 -280
- udata/core/dataset/permissions.py +9 -6
- udata/core/dataset/preview.py +15 -17
- udata/core/dataset/rdf.py +156 -122
- udata/core/dataset/search.py +92 -77
- udata/core/dataset/signals.py +1 -1
- udata/core/dataset/tasks.py +63 -54
- udata/core/discussions/actions.py +5 -5
- udata/core/discussions/api.py +124 -120
- udata/core/discussions/factories.py +2 -2
- udata/core/discussions/forms.py +9 -7
- udata/core/discussions/metrics.py +1 -3
- udata/core/discussions/models.py +25 -24
- udata/core/discussions/notifications.py +18 -14
- udata/core/discussions/permissions.py +3 -3
- udata/core/discussions/signals.py +4 -4
- udata/core/discussions/tasks.py +24 -28
- udata/core/followers/api.py +32 -33
- udata/core/followers/models.py +9 -9
- udata/core/followers/signals.py +3 -3
- udata/core/jobs/actions.py +7 -7
- udata/core/jobs/api.py +99 -92
- udata/core/jobs/commands.py +48 -49
- udata/core/jobs/forms.py +11 -11
- udata/core/jobs/models.py +6 -6
- udata/core/metrics/__init__.py +2 -2
- udata/core/metrics/commands.py +34 -30
- udata/core/metrics/models.py +2 -4
- udata/core/metrics/signals.py +1 -1
- udata/core/metrics/tasks.py +3 -3
- udata/core/organization/activities.py +12 -15
- udata/core/organization/api.py +167 -174
- udata/core/organization/api_fields.py +183 -124
- udata/core/organization/apiv2.py +32 -32
- udata/core/organization/commands.py +20 -22
- udata/core/organization/constants.py +11 -11
- udata/core/organization/csv.py +17 -15
- udata/core/organization/factories.py +8 -11
- udata/core/organization/forms.py +32 -26
- udata/core/organization/metrics.py +2 -1
- udata/core/organization/models.py +87 -67
- udata/core/organization/notifications.py +18 -14
- udata/core/organization/permissions.py +10 -11
- udata/core/organization/rdf.py +14 -14
- udata/core/organization/search.py +30 -28
- udata/core/organization/signals.py +7 -7
- udata/core/organization/tasks.py +42 -61
- udata/core/owned.py +38 -27
- udata/core/post/api.py +82 -81
- udata/core/post/constants.py +8 -5
- udata/core/post/factories.py +4 -4
- udata/core/post/forms.py +13 -14
- udata/core/post/models.py +20 -22
- udata/core/post/tests/test_api.py +30 -32
- udata/core/reports/api.py +8 -7
- udata/core/reports/constants.py +1 -3
- udata/core/reports/models.py +10 -10
- udata/core/reuse/activities.py +15 -19
- udata/core/reuse/api.py +123 -126
- udata/core/reuse/api_fields.py +120 -85
- udata/core/reuse/apiv2.py +11 -10
- udata/core/reuse/constants.py +23 -23
- udata/core/reuse/csv.py +18 -18
- udata/core/reuse/factories.py +5 -9
- udata/core/reuse/forms.py +24 -21
- udata/core/reuse/models.py +55 -51
- udata/core/reuse/permissions.py +2 -2
- udata/core/reuse/search.py +49 -46
- udata/core/reuse/signals.py +1 -1
- udata/core/reuse/tasks.py +4 -5
- udata/core/site/api.py +47 -50
- udata/core/site/factories.py +2 -2
- udata/core/site/forms.py +4 -5
- udata/core/site/models.py +94 -63
- udata/core/site/rdf.py +14 -14
- udata/core/spam/api.py +16 -9
- udata/core/spam/constants.py +4 -4
- udata/core/spam/fields.py +13 -7
- udata/core/spam/models.py +27 -20
- udata/core/spam/signals.py +1 -1
- udata/core/spam/tests/test_spam.py +6 -5
- udata/core/spatial/api.py +72 -80
- udata/core/spatial/api_fields.py +73 -58
- udata/core/spatial/commands.py +67 -64
- udata/core/spatial/constants.py +3 -3
- udata/core/spatial/factories.py +37 -54
- udata/core/spatial/forms.py +27 -26
- udata/core/spatial/geoids.py +17 -17
- udata/core/spatial/models.py +43 -47
- udata/core/spatial/tasks.py +2 -1
- udata/core/spatial/tests/test_api.py +115 -130
- udata/core/spatial/tests/test_fields.py +74 -77
- udata/core/spatial/tests/test_geoid.py +22 -22
- udata/core/spatial/tests/test_models.py +5 -7
- udata/core/spatial/translations.py +16 -16
- udata/core/storages/__init__.py +16 -18
- udata/core/storages/api.py +66 -64
- udata/core/storages/tasks.py +7 -7
- udata/core/storages/utils.py +15 -15
- udata/core/storages/views.py +5 -6
- udata/core/tags/api.py +17 -14
- udata/core/tags/csv.py +4 -4
- udata/core/tags/models.py +8 -5
- udata/core/tags/tasks.py +11 -13
- udata/core/tags/views.py +4 -4
- udata/core/topic/api.py +84 -73
- udata/core/topic/apiv2.py +157 -127
- udata/core/topic/factories.py +3 -4
- udata/core/topic/forms.py +12 -14
- udata/core/topic/models.py +14 -19
- udata/core/topic/parsers.py +26 -26
- udata/core/user/activities.py +30 -29
- udata/core/user/api.py +151 -152
- udata/core/user/api_fields.py +132 -100
- udata/core/user/apiv2.py +7 -7
- udata/core/user/commands.py +38 -38
- udata/core/user/factories.py +8 -9
- udata/core/user/forms.py +14 -11
- udata/core/user/metrics.py +2 -2
- udata/core/user/models.py +68 -69
- udata/core/user/permissions.py +4 -5
- udata/core/user/rdf.py +7 -8
- udata/core/user/tasks.py +2 -2
- udata/core/user/tests/test_user_model.py +24 -16
- udata/cors.py +99 -0
- udata/db/tasks.py +2 -1
- udata/entrypoints.py +35 -31
- udata/errors.py +2 -1
- udata/event/values.py +6 -6
- udata/factories.py +2 -2
- udata/features/identicon/api.py +5 -6
- udata/features/identicon/backends.py +48 -55
- udata/features/identicon/tests/test_backends.py +4 -5
- udata/features/notifications/__init__.py +0 -1
- udata/features/notifications/actions.py +9 -9
- udata/features/notifications/api.py +17 -13
- udata/features/territories/__init__.py +12 -10
- udata/features/territories/api.py +14 -15
- udata/features/territories/models.py +23 -28
- udata/features/transfer/actions.py +8 -11
- udata/features/transfer/api.py +84 -77
- udata/features/transfer/factories.py +2 -1
- udata/features/transfer/models.py +11 -12
- udata/features/transfer/notifications.py +19 -15
- udata/features/transfer/permissions.py +5 -5
- udata/forms/__init__.py +5 -2
- udata/forms/fields.py +164 -172
- udata/forms/validators.py +19 -22
- udata/forms/widgets.py +9 -13
- udata/frontend/__init__.py +31 -26
- udata/frontend/csv.py +68 -58
- udata/frontend/markdown.py +40 -44
- udata/harvest/actions.py +89 -77
- udata/harvest/api.py +294 -238
- udata/harvest/backends/__init__.py +4 -4
- udata/harvest/backends/base.py +128 -111
- udata/harvest/backends/dcat.py +80 -66
- udata/harvest/commands.py +56 -60
- udata/harvest/csv.py +8 -8
- udata/harvest/exceptions.py +6 -3
- udata/harvest/filters.py +24 -23
- udata/harvest/forms.py +27 -28
- udata/harvest/models.py +88 -80
- udata/harvest/notifications.py +15 -10
- udata/harvest/signals.py +13 -13
- udata/harvest/tasks.py +11 -10
- udata/harvest/tests/factories.py +23 -24
- udata/harvest/tests/test_actions.py +136 -166
- udata/harvest/tests/test_api.py +220 -214
- udata/harvest/tests/test_base_backend.py +117 -112
- udata/harvest/tests/test_dcat_backend.py +380 -308
- udata/harvest/tests/test_filters.py +33 -22
- udata/harvest/tests/test_models.py +11 -14
- udata/harvest/tests/test_notifications.py +6 -7
- udata/harvest/tests/test_tasks.py +7 -6
- udata/i18n.py +237 -78
- udata/linkchecker/backends.py +5 -11
- udata/linkchecker/checker.py +23 -22
- udata/linkchecker/commands.py +4 -6
- udata/linkchecker/models.py +6 -6
- udata/linkchecker/tasks.py +18 -20
- udata/mail.py +21 -21
- udata/migrations/2020-07-24-remove-s-from-scope-oauth.py +9 -8
- udata/migrations/2020-08-24-add-fs-filename.py +9 -8
- udata/migrations/2020-09-28-update-reuses-datasets-metrics.py +5 -4
- udata/migrations/2020-10-16-migrate-ods-resources.py +9 -10
- udata/migrations/2021-04-08-update-schema-with-new-structure.py +8 -7
- udata/migrations/2021-05-27-fix-default-schema-name.py +7 -6
- udata/migrations/2021-07-05-remove-unused-badges.py +17 -15
- udata/migrations/2021-07-07-update-schema-for-community-resources.py +7 -6
- udata/migrations/2021-08-17-follow-integrity.py +5 -4
- udata/migrations/2021-08-17-harvest-integrity.py +13 -12
- udata/migrations/2021-08-17-oauth2client-integrity.py +5 -4
- udata/migrations/2021-08-17-transfer-integrity.py +5 -4
- udata/migrations/2021-08-17-users-integrity.py +9 -8
- udata/migrations/2021-12-14-reuse-topics.py +7 -6
- udata/migrations/2022-04-21-improve-extension-detection.py +8 -7
- udata/migrations/2022-09-22-clean-inactive-harvest-datasets.py +16 -14
- udata/migrations/2022-10-10-add-fs_uniquifier-to-user-model.py +6 -6
- udata/migrations/2022-10-10-migrate-harvest-extras.py +36 -26
- udata/migrations/2023-02-08-rename-internal-dates.py +46 -28
- udata/migrations/2024-01-29-fix-reuse-and-dataset-with-private-None.py +10 -8
- udata/migrations/2024-03-22-migrate-activity-kwargs-to-extras.py +6 -4
- udata/migrations/2024-06-11-fix-reuse-datasets-references.py +7 -6
- udata/migrations/__init__.py +123 -105
- udata/models/__init__.py +4 -4
- udata/mongo/__init__.py +13 -11
- udata/mongo/badges_field.py +3 -2
- udata/mongo/datetime_fields.py +13 -12
- udata/mongo/document.py +17 -16
- udata/mongo/engine.py +15 -16
- udata/mongo/errors.py +2 -1
- udata/mongo/extras_fields.py +30 -20
- udata/mongo/queryset.py +12 -12
- udata/mongo/slug_fields.py +38 -28
- udata/mongo/taglist_field.py +1 -2
- udata/mongo/url_field.py +5 -5
- udata/mongo/uuid_fields.py +4 -3
- udata/notifications/__init__.py +1 -1
- udata/notifications/mattermost.py +10 -9
- udata/rdf.py +167 -188
- udata/routing.py +40 -45
- udata/search/__init__.py +18 -19
- udata/search/adapter.py +17 -16
- udata/search/commands.py +44 -51
- udata/search/fields.py +13 -20
- udata/search/query.py +23 -18
- udata/search/result.py +9 -10
- udata/sentry.py +21 -19
- udata/settings.py +262 -198
- udata/sitemap.py +8 -6
- udata/storage/s3.py +20 -13
- udata/tags.py +4 -5
- udata/tasks.py +43 -42
- udata/tests/__init__.py +9 -6
- udata/tests/api/__init__.py +8 -6
- udata/tests/api/test_auth_api.py +395 -321
- udata/tests/api/test_base_api.py +33 -35
- udata/tests/api/test_contact_points.py +7 -9
- udata/tests/api/test_dataservices_api.py +211 -158
- udata/tests/api/test_datasets_api.py +823 -812
- udata/tests/api/test_follow_api.py +13 -15
- udata/tests/api/test_me_api.py +95 -112
- udata/tests/api/test_organizations_api.py +301 -339
- udata/tests/api/test_reports_api.py +35 -25
- udata/tests/api/test_reuses_api.py +134 -139
- udata/tests/api/test_swagger.py +5 -5
- udata/tests/api/test_tags_api.py +18 -25
- udata/tests/api/test_topics_api.py +94 -94
- udata/tests/api/test_transfer_api.py +53 -48
- udata/tests/api/test_user_api.py +128 -141
- udata/tests/apiv2/test_datasets.py +290 -198
- udata/tests/apiv2/test_me_api.py +10 -11
- udata/tests/apiv2/test_organizations.py +56 -74
- udata/tests/apiv2/test_swagger.py +5 -5
- udata/tests/apiv2/test_topics.py +69 -87
- udata/tests/cli/test_cli_base.py +8 -8
- udata/tests/cli/test_db_cli.py +21 -19
- udata/tests/dataservice/test_dataservice_tasks.py +8 -12
- udata/tests/dataset/test_csv_adapter.py +44 -35
- udata/tests/dataset/test_dataset_actions.py +2 -3
- udata/tests/dataset/test_dataset_commands.py +7 -8
- udata/tests/dataset/test_dataset_events.py +36 -29
- udata/tests/dataset/test_dataset_model.py +224 -217
- udata/tests/dataset/test_dataset_rdf.py +142 -131
- udata/tests/dataset/test_dataset_tasks.py +15 -15
- udata/tests/dataset/test_resource_preview.py +10 -13
- udata/tests/features/territories/__init__.py +9 -13
- udata/tests/features/territories/test_territories_api.py +71 -91
- udata/tests/forms/test_basic_fields.py +7 -7
- udata/tests/forms/test_current_user_field.py +39 -66
- udata/tests/forms/test_daterange_field.py +31 -39
- udata/tests/forms/test_dict_field.py +28 -26
- udata/tests/forms/test_extras_fields.py +102 -76
- udata/tests/forms/test_form_field.py +8 -8
- udata/tests/forms/test_image_field.py +33 -26
- udata/tests/forms/test_model_field.py +134 -123
- udata/tests/forms/test_model_list_field.py +7 -7
- udata/tests/forms/test_nested_model_list_field.py +117 -79
- udata/tests/forms/test_publish_as_field.py +36 -65
- udata/tests/forms/test_reference_field.py +34 -53
- udata/tests/forms/test_user_forms.py +23 -21
- udata/tests/forms/test_uuid_field.py +6 -10
- udata/tests/frontend/__init__.py +9 -6
- udata/tests/frontend/test_auth.py +7 -6
- udata/tests/frontend/test_csv.py +81 -96
- udata/tests/frontend/test_hooks.py +43 -43
- udata/tests/frontend/test_markdown.py +211 -191
- udata/tests/helpers.py +32 -37
- udata/tests/models.py +2 -2
- udata/tests/organization/test_csv_adapter.py +21 -16
- udata/tests/organization/test_notifications.py +11 -18
- udata/tests/organization/test_organization_model.py +13 -13
- udata/tests/organization/test_organization_rdf.py +29 -22
- udata/tests/organization/test_organization_tasks.py +16 -17
- udata/tests/plugin.py +79 -73
- udata/tests/reuse/test_reuse_model.py +21 -21
- udata/tests/reuse/test_reuse_task.py +11 -13
- udata/tests/search/__init__.py +11 -12
- udata/tests/search/test_adapter.py +60 -70
- udata/tests/search/test_query.py +16 -16
- udata/tests/search/test_results.py +10 -7
- udata/tests/site/test_site_api.py +11 -16
- udata/tests/site/test_site_metrics.py +20 -30
- udata/tests/site/test_site_model.py +4 -5
- udata/tests/site/test_site_rdf.py +94 -78
- udata/tests/test_activity.py +17 -17
- udata/tests/test_cors.py +62 -0
- udata/tests/test_discussions.py +292 -299
- udata/tests/test_i18n.py +37 -40
- udata/tests/test_linkchecker.py +91 -85
- udata/tests/test_mail.py +13 -17
- udata/tests/test_migrations.py +219 -180
- udata/tests/test_model.py +164 -157
- udata/tests/test_notifications.py +17 -17
- udata/tests/test_owned.py +14 -14
- udata/tests/test_rdf.py +25 -23
- udata/tests/test_routing.py +89 -93
- udata/tests/test_storages.py +137 -128
- udata/tests/test_tags.py +44 -46
- udata/tests/test_topics.py +7 -7
- udata/tests/test_transfer.py +42 -49
- udata/tests/test_uris.py +160 -161
- udata/tests/test_utils.py +79 -71
- udata/tests/user/test_user_rdf.py +5 -9
- udata/tests/workers/test_jobs_commands.py +57 -58
- udata/tests/workers/test_tasks_routing.py +23 -29
- udata/tests/workers/test_workers_api.py +125 -131
- udata/tests/workers/test_workers_helpers.py +6 -6
- udata/tracking.py +4 -6
- udata/uris.py +45 -46
- udata/utils.py +68 -66
- udata/wsgi.py +1 -1
- {udata-9.1.2.dev30355.dist-info → udata-9.1.2.dev30454.dist-info}/METADATA +7 -3
- udata-9.1.2.dev30454.dist-info/RECORD +706 -0
- udata-9.1.2.dev30355.dist-info/RECORD +0 -704
- {udata-9.1.2.dev30355.dist-info → udata-9.1.2.dev30454.dist-info}/LICENSE +0 -0
- {udata-9.1.2.dev30355.dist-info → udata-9.1.2.dev30454.dist-info}/WHEEL +0 -0
- {udata-9.1.2.dev30355.dist-info → udata-9.1.2.dev30454.dist-info}/entry_points.txt +0 -0
- {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
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 =
|
|
25
|
-
SECRET_KEY =
|
|
26
|
-
CONTACT_EMAIL =
|
|
27
|
-
TERRITORIES_EMAIL =
|
|
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 =
|
|
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 =
|
|
35
|
+
CELERY_BROKER_URL = "redis://localhost:6379"
|
|
38
36
|
CELERY_BROKER_TRANSPORT_OPTIONS = {
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
"fanout_prefix": True,
|
|
38
|
+
"fanout_patterns": True,
|
|
41
39
|
}
|
|
42
|
-
CELERY_RESULT_BACKEND =
|
|
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 =
|
|
46
|
-
CELERY_RESULT_SERIALIZER =
|
|
47
|
-
CELERY_ACCEPT_CONTENT = [
|
|
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 =
|
|
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 =
|
|
52
|
+
CELERY_TASK_DEFAULT_QUEUE = "default"
|
|
55
53
|
CELERY_TASK_QUEUES = (
|
|
56
54
|
# Default queue (on default exchange)
|
|
57
|
-
Queue(
|
|
55
|
+
Queue("default", routing_key="task.#"),
|
|
58
56
|
# High priority for urgent tasks
|
|
59
|
-
Queue(
|
|
57
|
+
Queue("high", Exchange("high", type="topic"), routing_key="high.#"),
|
|
60
58
|
# Low priority for slow tasks
|
|
61
|
-
Queue(
|
|
59
|
+
Queue("low", Exchange("low", type="topic"), routing_key="low.#"),
|
|
62
60
|
)
|
|
63
|
-
CELERY_TASK_DEFAULT_EXCHANGE =
|
|
64
|
-
CELERY_TASK_DEFAULT_EXCHANGE_TYPE =
|
|
65
|
-
CELERY_TASK_DEFAULT_ROUTING_KEY =
|
|
66
|
-
CELERY_TASK_ROUTES =
|
|
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 =
|
|
69
|
-
CACHE_TYPE =
|
|
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 =
|
|
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 =
|
|
89
|
-
SECURITY_PASSWORD_NORMALIZE_FORM =
|
|
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 =
|
|
97
|
-
SECURITY_CONFIRM_SALT =
|
|
98
|
-
SECURITY_RESET_SALT =
|
|
99
|
-
SECURITY_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 = _(
|
|
104
|
-
SECURITY_EMAIL_SUBJECT_CONFIRM = _(
|
|
105
|
-
SECURITY_EMAIL_SUBJECT_PASSWORDLESS = _(
|
|
106
|
-
SECURITY_EMAIL_SUBJECT_PASSWORD_NOTICE = _(
|
|
107
|
-
SECURITY_EMAIL_SUBJECT_PASSWORD_CHANGE_NOTICE = _(
|
|
108
|
-
|
|
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 = [
|
|
117
|
-
SENTRY_LOGGING =
|
|
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 =
|
|
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 =
|
|
131
|
-
SITE_TITLE =
|
|
132
|
-
SITE_KEYWORDS = [
|
|
127
|
+
SITE_ID = "default"
|
|
128
|
+
SITE_TITLE = "uData"
|
|
129
|
+
SITE_KEYWORDS = ["opendata", "udata"]
|
|
133
130
|
SITE_AUTHOR_URL = None
|
|
134
|
-
SITE_AUTHOR =
|
|
135
|
-
SITE_GITHUB_URL =
|
|
136
|
-
SITE_TERMS_LOCATION = pkg_resources.resource_filename(__name__,
|
|
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 =
|
|
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 =
|
|
143
|
+
OAUTH2_PROVIDER_ERROR_ENDPOINT = "oauth.oauth_error"
|
|
147
144
|
OAUTH2_REFRESH_TOKEN_GENERATOR = True
|
|
148
145
|
OAUTH2_TOKEN_EXPIRES_IN = {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
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
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
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 = [
|
|
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 =
|
|
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
|
|
270
|
-
HARVEST_GRAPHS_S3_BUCKET = None
|
|
271
|
-
HARVEST_GRAPHS_S3_FILENAME_PREFIX =
|
|
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 = (
|
|
284
|
+
LINKCHECKING_UNCHECKED_TYPES = ("api",)
|
|
288
285
|
LINKCHECKING_IGNORE_DOMAINS = []
|
|
289
|
-
LINKCHECKING_IGNORE_PATTERNS = [
|
|
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 =
|
|
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
|
-
|
|
299
|
-
|
|
300
|
-
|
|
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
|
-
|
|
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
|
-
|
|
321
|
+
"csv",
|
|
322
|
+
"txt",
|
|
323
|
+
"json",
|
|
324
|
+
"pdf",
|
|
325
|
+
"xml",
|
|
326
|
+
"rtf",
|
|
327
|
+
"xsd",
|
|
318
328
|
# OpenOffice
|
|
319
|
-
|
|
329
|
+
"ods",
|
|
330
|
+
"odt",
|
|
331
|
+
"odp",
|
|
332
|
+
"odg",
|
|
320
333
|
# Microsoft Office
|
|
321
|
-
|
|
334
|
+
"xls",
|
|
335
|
+
"xlsx",
|
|
336
|
+
"doc",
|
|
337
|
+
"docx",
|
|
338
|
+
"pps",
|
|
339
|
+
"ppt",
|
|
322
340
|
# Images
|
|
323
|
-
|
|
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
|
-
|
|
353
|
+
"shp",
|
|
354
|
+
"kml",
|
|
355
|
+
"kmz",
|
|
356
|
+
"gpx",
|
|
357
|
+
"shx",
|
|
358
|
+
"ovr",
|
|
359
|
+
"geojson",
|
|
360
|
+
"gpkg",
|
|
326
361
|
# Meteorology
|
|
327
|
-
|
|
362
|
+
"grib2",
|
|
328
363
|
# RDF
|
|
329
|
-
|
|
364
|
+
"rdf",
|
|
365
|
+
"ttl",
|
|
366
|
+
"n3",
|
|
330
367
|
# Misc
|
|
331
|
-
|
|
332
|
-
|
|
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
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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 =
|
|
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 =
|
|
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 = (
|
|
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 = (
|
|
426
|
-
|
|
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 = _(
|
|
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 =
|
|
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 = [
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
494
|
-
CACHE_TYPE =
|
|
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 =
|
|
498
|
-
DEFAULT_LANGUAGE =
|
|
559
|
+
SERVER_NAME = "local.test"
|
|
560
|
+
DEFAULT_LANGUAGE = "fr"
|
|
499
561
|
ACTIVATE_TERRITORIES = False
|
|
500
|
-
LOGGER_HANDLER_POLICY =
|
|
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([
|
|
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 = {
|
|
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
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
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 =
|
|
589
|
+
CACHE_TYPE = "flask_caching.backends.null"
|
|
526
590
|
CACHE_NO_NULL_WARNING = True
|