diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 589ff0187..0fec363b2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -7,16 +7,12 @@ repos: - id: trailing-whitespace exclude_types: [sql] -- repo: https://github.com/psf/black - rev: 24.10.0 - hooks: - - id: black - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.8.0" + rev: v0.9.6 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] + - id: ruff-format - repo: https://github.com/adamchainz/django-upgrade rev: "1.22.1" @@ -25,8 +21,7 @@ repos: args: [--target-version, "5.0"] - repo: https://github.com/astral-sh/uv-pre-commit - # uv version. - rev: 0.5.30 + rev: 0.6.0 hooks: - id: uv-lock - id: uv-export diff --git a/manage.py b/manage.py index 9c4bf9493..9e55a451b 100755 --- a/manage.py +++ b/manage.py @@ -1,5 +1,6 @@ #!/usr/bin/env python """Django's command-line utility for administrative tasks.""" + import os import sys diff --git a/notebooks/dsrc_doc/ComponentTemplate.py b/notebooks/dsrc_doc/ComponentTemplate.py index b1c7c44f4..d1004c546 100644 --- a/notebooks/dsrc_doc/ComponentTemplate.py +++ b/notebooks/dsrc_doc/ComponentTemplate.py @@ -96,7 +96,10 @@ def _load_asset(rel_file_path): ) context = Context( - {"projects": projects.order_by("-created_on")[:5], "csscore": csscore.data} + { + "projects": projects.order_by("-created_on")[:5], + "csscore": csscore.data, + } ) HTML(template.render(context)) diff --git a/pyproject.toml b/pyproject.toml index 1662b03bd..2adbf7b0f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,11 +2,11 @@ name = "recoco" dynamic = ["version"] -authors = [{name = "Recoco Dev Team"}] +authors = [{ name = "Recoco Dev Team" }] maintainers = [ - {name = "Guillaume Libersat", email = "guillaume.libersat@beta.gouv.fr"} + { name = "Guillaume Libersat", email = "guillaume.libersat@beta.gouv.fr" }, ] -license = {name = "AGPL-v3", file="LICENSE"} +license = { name = "AGPL-v3", file = "LICENSE" } description = "Recommandations Collaboratives" readme = "README.md" @@ -82,7 +82,7 @@ Repository = "https://github.com/betagouv/recommandations-collaboratives/" packages = ["recoco"] [tool.setuptools.dynamic] -version = {attr = "recoco.__version__"} +version = { attr = "recoco.__version__" } [build-system] requires = ["setuptools"] @@ -194,7 +194,6 @@ django-webhook = { git = "https://github.com/etchegom/django-webhook.git", rev = [dependency-groups] dev = [ - "black>=25.1.0", "coverage==7.4.1", "django-coverage-plugin>=3.1.0", "django-debug-toolbar==4.3.0", @@ -231,3 +230,11 @@ dev = [ "sphinxcontrib-django>=2.5", "sphinxcontrib-django-urls>=0.3", ] + + +[tool.ruff] +line-length = 88 + +[tool.ruff.format] +skip-magic-trailing-comma = false +exclude = ["*.ipynb", "fabfile.py", "notebooks/*", "sql/*", "frontend_tests/*", "docs/*", "node_modules/*"] diff --git a/recoco/apps/addressbook/admin.py b/recoco/apps/addressbook/admin.py index 5098334d6..848c5feb4 100644 --- a/recoco/apps/addressbook/admin.py +++ b/recoco/apps/addressbook/admin.py @@ -13,7 +13,7 @@ class OrganizationGroupAdmin(admin.ModelAdmin): @admin.register(models.Organization) class OrganizationAdmin(admin.ModelAdmin): - search_fields = ["name" "group__name"] + search_fields = ["name", "group__name"] list_display = ["name"] ordering = ["name"] list_filter = ["sites", "group"] diff --git a/recoco/apps/addressbook/migrations/0010_organizationgroup_organization_group.py b/recoco/apps/addressbook/migrations/0010_organizationgroup_organization_group.py index ffa8cdcaf..973530a8e 100644 --- a/recoco/apps/addressbook/migrations/0010_organizationgroup_organization_group.py +++ b/recoco/apps/addressbook/migrations/0010_organizationgroup_organization_group.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("addressbook", "0009_alter_organization_departments"), ] diff --git a/recoco/apps/addressbook/migrations/0011_contact_created_contact_modified_and_more.py b/recoco/apps/addressbook/migrations/0011_contact_created_contact_modified_and_more.py index f6d1a1669..2a8c72b67 100644 --- a/recoco/apps/addressbook/migrations/0011_contact_created_contact_modified_and_more.py +++ b/recoco/apps/addressbook/migrations/0011_contact_created_contact_modified_and_more.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ ("addressbook", "0010_organizationgroup_organization_group"), ] diff --git a/recoco/apps/addressbook/tests/test_rest_contact.py b/recoco/apps/addressbook/tests/test_rest_contact.py index 0a617196a..19f8efead 100644 --- a/recoco/apps/addressbook/tests/test_rest_contact.py +++ b/recoco/apps/addressbook/tests/test_rest_contact.py @@ -164,9 +164,9 @@ def test_contact_search_filter( reverse("api-addressbook-contact-list"), {"search": search_terms} ) assert response.status_code == 200 - assert [ - contact["id"] for contact in response.data["results"] - ] == expected_result, f"failure for search terms: {search_terms}" + assert [contact["id"] for contact in response.data["results"]] == expected_result, ( + f"failure for search terms: {search_terms}" + ) @pytest.mark.parametrize( diff --git a/recoco/apps/addressbook/tests/test_views_organization.py b/recoco/apps/addressbook/tests/test_views_organization.py index bd3600c16..bc20b1b1a 100644 --- a/recoco/apps/addressbook/tests/test_views_organization.py +++ b/recoco/apps/addressbook/tests/test_views_organization.py @@ -56,7 +56,6 @@ def test_organization_list_not_available_for_non_staff(client): @pytest.mark.django_db def test_create_existing_organization_and_redirect(current_site, client): - organization = Recipe( Organization, sites=[current_site], name="my organization" ).make() diff --git a/recoco/apps/addressbook/urls.py b/recoco/apps/addressbook/urls.py index 9e0d46868..a7aef09ef 100644 --- a/recoco/apps/addressbook/urls.py +++ b/recoco/apps/addressbook/urls.py @@ -7,7 +7,6 @@ created : 2021-07-16 16:22:25 CEST """ - from django.urls import path from . import views diff --git a/recoco/apps/communication/management/commands/senddigests.py b/recoco/apps/communication/management/commands/senddigests.py index 72776a6b4..17df866f3 100644 --- a/recoco/apps/communication/management/commands/senddigests.py +++ b/recoco/apps/communication/management/commands/senddigests.py @@ -7,7 +7,6 @@ created: 2022-01-24 22:39:27 CEST """ - import logging from django.conf import settings diff --git a/recoco/apps/communication/management/commands/sendtestdigest.py b/recoco/apps/communication/management/commands/sendtestdigest.py index af2cc1726..80f1400f1 100644 --- a/recoco/apps/communication/management/commands/sendtestdigest.py +++ b/recoco/apps/communication/management/commands/sendtestdigest.py @@ -7,7 +7,6 @@ created: 2022-01-24 22:39:27 CEST """ - import json from django.core.management.base import BaseCommand diff --git a/recoco/apps/communication/migrations/0013_alter_emailtemplate_name.py b/recoco/apps/communication/migrations/0013_alter_emailtemplate_name.py index b867f7fcb..637c7197a 100644 --- a/recoco/apps/communication/migrations/0013_alter_emailtemplate_name.py +++ b/recoco/apps/communication/migrations/0013_alter_emailtemplate_name.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("communication", "0012_alter_emailtemplate_site"), ] diff --git a/recoco/apps/crm/urls.py b/recoco/apps/crm/urls.py index c1cdba2e7..afaba707d 100644 --- a/recoco/apps/crm/urls.py +++ b/recoco/apps/crm/urls.py @@ -7,7 +7,6 @@ created : 2022-07-19 17:27:25 CEST """ - from django.urls import path from . import views diff --git a/recoco/apps/demarches_simplifiees/migrations/0001_initial.py b/recoco/apps/demarches_simplifiees/migrations/0001_initial.py index 6f960983f..e413414c6 100644 --- a/recoco/apps/demarches_simplifiees/migrations/0001_initial.py +++ b/recoco/apps/demarches_simplifiees/migrations/0001_initial.py @@ -7,7 +7,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/recoco/apps/demarches_simplifiees/migrations/0002_remove_dsresource_type.py b/recoco/apps/demarches_simplifiees/migrations/0002_remove_dsresource_type.py index 239e2bf56..5a4855897 100644 --- a/recoco/apps/demarches_simplifiees/migrations/0002_remove_dsresource_type.py +++ b/recoco/apps/demarches_simplifiees/migrations/0002_remove_dsresource_type.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("demarches_simplifiees", "0001_initial"), ] diff --git a/recoco/apps/demarches_simplifiees/migrations/0003_dsmapping.py b/recoco/apps/demarches_simplifiees/migrations/0003_dsmapping.py index 03780c0e6..f13105bf2 100644 --- a/recoco/apps/demarches_simplifiees/migrations/0003_dsmapping.py +++ b/recoco/apps/demarches_simplifiees/migrations/0003_dsmapping.py @@ -7,7 +7,6 @@ class Migration(migrations.Migration): - dependencies = [ ("sites", "0002_alter_domain_unique"), ("demarches_simplifiees", "0002_remove_dsresource_type"), diff --git a/recoco/apps/demarches_simplifiees/tests/conftest.py b/recoco/apps/demarches_simplifiees/tests/conftest.py index ffa58f70d..ad60924b4 100644 --- a/recoco/apps/demarches_simplifiees/tests/conftest.py +++ b/recoco/apps/demarches_simplifiees/tests/conftest.py @@ -30,7 +30,7 @@ def ds_schema_sample(): "description": "Ce formulaire est destiné aux collectivités de Moselle qui souhaitent déposer une demande de subvention au titre de la DETR ou de la DSIL en 2024. Votre demande sera automatiquement orientée vers la sous-préfecture compétente.\r\n\r\nLa date limite de dépôt des dossiers est fixée au 30 novembre 2023.\r\n\r\nDans le cadre de l'instruction des demandes, les projets sont orientés par les sous-préfets en lien avec la préfecture vers la dotation la plus adaptée (DETR ou DSIL).\r\n\r\nPour l'éligibilité des opérations, il convient de se référer à l’appel à projets 2024 commun à la DETR et à la DSIL, disponible à l'adresse suivante : https://www.moselle.gouv.fr/Actions-de-l-Etat/Collectivites-controle-de-legalite-et-finances-locales/Subventions\r\n\r\n", "required": False, "collapsibleExplanationEnabled": True, - "collapsibleExplanationText": "\r\nPour constituer votre dossier, les sections suivantes sont à compléter :\r\n\r\n-Informations sur le porteur de projet\r\n-Présentation de l'opération\r\n-Plan de financement prévisionnel\r\n-Finalisation du dossier\r\n\r\n\r\n\u003Cbr /\u003E\r\n\r\nVotre dossier est enregistré automatiquement après chaque modification. Vous pouvez à tout moment fermer la fenêtre et reprendre plus tard là où vous en étiez.", + "collapsibleExplanationText": "\r\nPour constituer votre dossier, les sections suivantes sont à compléter :\r\n\r\n-Informations sur le porteur de projet\r\n-Présentation de l'opération\r\n-Plan de financement prévisionnel\r\n-Finalisation du dossier\r\n\r\n\r\n\u003cbr /\u003e\r\n\r\nVotre dossier est enregistré automatiquement après chaque modification. Vous pouvez à tout moment fermer la fenêtre et reprendre plus tard là où vous en étiez.", }, { "__typename": "YesNoChampDescriptor", diff --git a/recoco/apps/demarches_simplifiees/tests/test_signals.py b/recoco/apps/demarches_simplifiees/tests/test_signals.py index 4f3a01ca0..e44dfa7ae 100644 --- a/recoco/apps/demarches_simplifiees/tests/test_signals.py +++ b/recoco/apps/demarches_simplifiees/tests/test_signals.py @@ -16,7 +16,6 @@ def test_trigger_load_ds_resource_schema(settings, autoload_enabled, expected_ca with patch( "recoco.apps.demarches_simplifiees.signals.load_ds_resource_schema" ) as mock_load_ds_resource_schema: - ds_resource = baker.make(DSResource) ds_resource.schema = {"number": 123} ds_resource.save() diff --git a/recoco/apps/dsrc/urls.py b/recoco/apps/dsrc/urls.py index 93761c4e6..48c7c4992 100644 --- a/recoco/apps/dsrc/urls.py +++ b/recoco/apps/dsrc/urls.py @@ -7,7 +7,6 @@ created : 2024-03-02 01:13:25 CEST """ - from django.urls import path from . import views diff --git a/recoco/apps/feature_flag/migrations/0001_initial.py b/recoco/apps/feature_flag/migrations/0001_initial.py index f488447d9..56806c0cb 100644 --- a/recoco/apps/feature_flag/migrations/0001_initial.py +++ b/recoco/apps/feature_flag/migrations/0001_initial.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/recoco/apps/geomatics/migrations/0005_alter_commune_unique_together.py b/recoco/apps/geomatics/migrations/0005_alter_commune_unique_together.py index 7ff090fc1..c92c4f3bf 100644 --- a/recoco/apps/geomatics/migrations/0005_alter_commune_unique_together.py +++ b/recoco/apps/geomatics/migrations/0005_alter_commune_unique_together.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("geomatics", "0004_alter_department_region"), ] diff --git a/recoco/apps/geomatics/models.py b/recoco/apps/geomatics/models.py index a2c9dd405..821491f30 100644 --- a/recoco/apps/geomatics/models.py +++ b/recoco/apps/geomatics/models.py @@ -7,7 +7,6 @@ created: 2021-07-12 12:05:28 CEST """ - from django.db import models diff --git a/recoco/apps/hitcount/migrations/0001_initial.py b/recoco/apps/hitcount/migrations/0001_initial.py index af75a08ae..2ebd7a92e 100644 --- a/recoco/apps/hitcount/migrations/0001_initial.py +++ b/recoco/apps/hitcount/migrations/0001_initial.py @@ -8,7 +8,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/recoco/apps/hitcount/migrations/0002_alter_hit_hitcount_alter_hit_user_and_more.py b/recoco/apps/hitcount/migrations/0002_alter_hit_hitcount_alter_hit_user_and_more.py index ef65a31e7..24f926f01 100644 --- a/recoco/apps/hitcount/migrations/0002_alter_hit_hitcount_alter_hit_user_and_more.py +++ b/recoco/apps/hitcount/migrations/0002_alter_hit_hitcount_alter_hit_user_and_more.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("hitcount", "0001_initial"), diff --git a/recoco/apps/hitcount/tests/test_views.py b/recoco/apps/hitcount/tests/test_views.py index 6e9f1eff1..e8ca74b2f 100644 --- a/recoco/apps/hitcount/tests/test_views.py +++ b/recoco/apps/hitcount/tests/test_views.py @@ -60,6 +60,6 @@ def test_hit_view(): ) assert response.status_code == 200 assert HitCount.objects.count() == 1 - assert ( - hitcount.hits.count() == 2 - ), "no hit should be registered when user is hijacked" + assert hitcount.hits.count() == 2, ( + "no hit should be registered when user is hijacked" + ) diff --git a/recoco/apps/home/forms.py b/recoco/apps/home/forms.py index b5b7cc37e..8eca467b7 100644 --- a/recoco/apps/home/forms.py +++ b/recoco/apps/home/forms.py @@ -28,9 +28,9 @@ class UVSignupForm(SignupForm): def __init__(self, *args, **kwargs): super(UVSignupForm, self).__init__(*args, **kwargs) - self.fields["password1"].label = ( - "Définissez votre mot de passe (8 caractères minimum)" - ) + self.fields[ + "password1" + ].label = "Définissez votre mot de passe (8 caractères minimum)" self.fields["password1"].widget = forms.PasswordInput( attrs={"class": "fr-input fr-mt-2v fr-mb-4v"} ) diff --git a/recoco/apps/home/management/commands/create_site.py b/recoco/apps/home/management/commands/create_site.py index 85964bf11..2bc4f89b4 100644 --- a/recoco/apps/home/management/commands/create_site.py +++ b/recoco/apps/home/management/commands/create_site.py @@ -71,7 +71,6 @@ def handle(self, *args, **options): email_logo = options["email_logo"] try: - admin_user = None if options["admin_user"]: admin_user = User.objects.get(username=options["admin_user"]) diff --git a/recoco/apps/home/migrations/0024_siteconfiguration_onboarding_questions.py b/recoco/apps/home/migrations/0024_siteconfiguration_onboarding_questions.py index 08942d80e..c36e50c67 100644 --- a/recoco/apps/home/migrations/0024_siteconfiguration_onboarding_questions.py +++ b/recoco/apps/home/migrations/0024_siteconfiguration_onboarding_questions.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("survey", "0033_alter_session_project"), ("home", "0023_auto_20240206_1216"), diff --git a/recoco/apps/home/migrations/0026_merge_20240422_0744.py b/recoco/apps/home/migrations/0026_merge_20240422_0744.py index ac1a64f08..5e1bc8068 100644 --- a/recoco/apps/home/migrations/0026_merge_20240422_0744.py +++ b/recoco/apps/home/migrations/0026_merge_20240422_0744.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("home", "0024_siteconfiguration_onboarding_questions"), ("home", "0025_siteconfiguration_legal_address"), diff --git a/recoco/apps/home/migrations/0026_merge_20240422_1101.py b/recoco/apps/home/migrations/0026_merge_20240422_1101.py index 5cc76c258..a5a2bfbf4 100644 --- a/recoco/apps/home/migrations/0026_merge_20240422_1101.py +++ b/recoco/apps/home/migrations/0026_merge_20240422_1101.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("home", "0024_siteconfiguration_onboarding_questions"), ("home", "0025_siteconfiguration_legal_address"), diff --git a/recoco/apps/home/migrations/0027_merge_20240423_1117.py b/recoco/apps/home/migrations/0027_merge_20240423_1117.py index 676099997..68ce7fa6e 100644 --- a/recoco/apps/home/migrations/0027_merge_20240423_1117.py +++ b/recoco/apps/home/migrations/0027_merge_20240423_1117.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("home", "0026_merge_20240422_0744"), ("home", "0026_merge_20240422_1101"), diff --git a/recoco/apps/home/migrations/0030_siteconfiguration_logo_large_and_more.py b/recoco/apps/home/migrations/0030_siteconfiguration_logo_large_and_more.py index eba0d9da6..6790973aa 100644 --- a/recoco/apps/home/migrations/0030_siteconfiguration_logo_large_and_more.py +++ b/recoco/apps/home/migrations/0030_siteconfiguration_logo_large_and_more.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("home", "0029_siteconfiguration_description"), ] diff --git a/recoco/apps/home/migrations/0031_alter_siteconfiguration_contact_form_recipient_and_more.py b/recoco/apps/home/migrations/0031_alter_siteconfiguration_contact_form_recipient_and_more.py index f1d92e878..6cf67c92b 100644 --- a/recoco/apps/home/migrations/0031_alter_siteconfiguration_contact_form_recipient_and_more.py +++ b/recoco/apps/home/migrations/0031_alter_siteconfiguration_contact_form_recipient_and_more.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ ("taggit", "0005_auto_20220424_2025"), ("home", "0030_siteconfiguration_logo_large_and_more"), diff --git a/recoco/apps/home/migrations/0032_siteconfiguration_accept_handover_and_more.py b/recoco/apps/home/migrations/0032_siteconfiguration_accept_handover_and_more.py index 7421cb695..968d9d2a8 100644 --- a/recoco/apps/home/migrations/0032_siteconfiguration_accept_handover_and_more.py +++ b/recoco/apps/home/migrations/0032_siteconfiguration_accept_handover_and_more.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ ("taggit", "0005_auto_20220424_2025"), ("home", "0031_alter_siteconfiguration_contact_form_recipient_and_more"), diff --git a/recoco/apps/home/migrations/0033_siteconfiguration_main_topic.py b/recoco/apps/home/migrations/0033_siteconfiguration_main_topic.py index 16bd8b025..14d9d8076 100644 --- a/recoco/apps/home/migrations/0033_siteconfiguration_main_topic.py +++ b/recoco/apps/home/migrations/0033_siteconfiguration_main_topic.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("home", "0032_siteconfiguration_accept_handover_and_more"), ] diff --git a/recoco/apps/home/migrations/0034_siteconfiguration_crisp_token.py b/recoco/apps/home/migrations/0034_siteconfiguration_crisp_token.py index 315914182..75e32a189 100644 --- a/recoco/apps/home/migrations/0034_siteconfiguration_crisp_token.py +++ b/recoco/apps/home/migrations/0034_siteconfiguration_crisp_token.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("home", "0033_siteconfiguration_main_topic"), ] diff --git a/recoco/apps/home/rest.py b/recoco/apps/home/rest.py index 5a63fc1b2..238a729f0 100644 --- a/recoco/apps/home/rest.py +++ b/recoco/apps/home/rest.py @@ -12,7 +12,6 @@ class UserNotificationsMarkOneAsRead(APIView): - permission_classes = [IsAuthenticated] def patch(self, request, pk): @@ -33,7 +32,6 @@ def patch(self, request, pk): class UserNotificationsMarkAllAsRead(APIView): - permission_classes = [IsAuthenticated] def patch(self, request, *args, **kwargs): diff --git a/recoco/apps/home/serializers.py b/recoco/apps/home/serializers.py index 5b1b74830..3626a9a12 100644 --- a/recoco/apps/home/serializers.py +++ b/recoco/apps/home/serializers.py @@ -7,7 +7,6 @@ created: 2022-05-16 17:44:55 CET """ - from django.contrib.auth import models as auth_models from django.contrib.sites import models as sites_models from rest_framework import serializers diff --git a/recoco/apps/home/tests/test_rest.py b/recoco/apps/home/tests/test_rest.py index 42d121fe0..957a1c4fa 100644 --- a/recoco/apps/home/tests/test_rest.py +++ b/recoco/apps/home/tests/test_rest.py @@ -11,7 +11,6 @@ @pytest.mark.django_db def test_user_notifications_try_mark_one_as_read_unauthorized(request): - site = get_current_site(request) project = baker.make(project_models.Project, sites=[site]) user = baker.make(auth_models.User) @@ -34,7 +33,6 @@ def test_user_notifications_try_mark_one_as_read_unauthorized(request): @pytest.mark.django_db def test_user_notifications_mark_one_as_read(request): - site = get_current_site(request) project = baker.make(project_models.Project, sites=[site]) user = baker.make(auth_models.User) @@ -67,7 +65,6 @@ def test_user_notifications_mark_one_as_read(request): @pytest.mark.django_db def test_user_notifications_mark_all_as_read(request): - site = get_current_site(request) project = baker.make(project_models.Project, sites=[site]) diff --git a/recoco/apps/home/utils.py b/recoco/apps/home/utils.py index 298f75051..50deadc86 100644 --- a/recoco/apps/home/utils.py +++ b/recoco/apps/home/utils.py @@ -6,6 +6,7 @@ authors: raphael@beta.gouv.fr, guillaume.libersat@beta.gouv.fr created: 2021-06-08 09:56:53 CEST """ + import os from typing import Optional diff --git a/recoco/apps/invites/tests.py b/recoco/apps/invites/tests.py index c4b127823..b073b35af 100644 --- a/recoco/apps/invites/tests.py +++ b/recoco/apps/invites/tests.py @@ -7,7 +7,6 @@ created: 2022-04-20 10:11:56 CEST """ - import pytest from django.contrib.auth import models as auth_models from django.contrib.sites.shortcuts import get_current_site diff --git a/recoco/apps/invites/urls.py b/recoco/apps/invites/urls.py index a72a09167..95d3d307d 100644 --- a/recoco/apps/invites/urls.py +++ b/recoco/apps/invites/urls.py @@ -7,7 +7,6 @@ created : 2022-04-19 14:54:25 CEST """ - from django.urls import path from . import views diff --git a/recoco/apps/metrics/metabase.py b/recoco/apps/metrics/metabase.py index e358b3c29..c6ba7822a 100644 --- a/recoco/apps/metrics/metabase.py +++ b/recoco/apps/metrics/metabase.py @@ -12,7 +12,6 @@ def clone_collection( source_collection_id: int, new_collection_name: str, target_schema: str ): - # https://pypi.org/project/metabase-api/ # https://www.metabase.com/docs/latest/api-documentation # authentication using API key (is_admin=False is set to avoid friendly table name alert) @@ -88,7 +87,6 @@ def clone_collection( dashcards = [] for dashcard in source_dashboard_data["dashcards"]: - # init new card with id card switch new_dashcard = { "id": -1, diff --git a/recoco/apps/onboarding/views.py b/recoco/apps/onboarding/views.py index 8394a9a49..c3200287d 100644 --- a/recoco/apps/onboarding/views.py +++ b/recoco/apps/onboarding/views.py @@ -456,11 +456,7 @@ def create_initial_note( projects.Note.objects.create( project=project, - content=( - f"# Demande initiale\n\n" - f"{project.description}\n\n" - f"{ markdown_content }" - ), + content=(f"# Demande initiale\n\n{project.description}\n\n{markdown_content}"), public=True, site=site, ) diff --git a/recoco/apps/pages/migrations/0001_initial.py b/recoco/apps/pages/migrations/0001_initial.py index 82b22ca16..ca24a2321 100644 --- a/recoco/apps/pages/migrations/0001_initial.py +++ b/recoco/apps/pages/migrations/0001_initial.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/recoco/apps/pages/migrations/0002_showcasepage.py b/recoco/apps/pages/migrations/0002_showcasepage.py index f5e90c5fa..3540c26de 100644 --- a/recoco/apps/pages/migrations/0002_showcasepage.py +++ b/recoco/apps/pages/migrations/0002_showcasepage.py @@ -8,7 +8,6 @@ class Migration(migrations.Migration): - dependencies = [ ("wagtailcore", "0093_uploadedfile"), ("pages", "0001_initial"), diff --git a/recoco/apps/pages/migrations/0003_alter_showcasepage_content_and_more.py b/recoco/apps/pages/migrations/0003_alter_showcasepage_content_and_more.py index 3235c420e..4ed686cf4 100644 --- a/recoco/apps/pages/migrations/0003_alter_showcasepage_content_and_more.py +++ b/recoco/apps/pages/migrations/0003_alter_showcasepage_content_and_more.py @@ -7,7 +7,6 @@ class Migration(migrations.Migration): - dependencies = [ ("pages", "0002_showcasepage"), ] diff --git a/recoco/apps/pages/migrations/0004_showcaselistpage.py b/recoco/apps/pages/migrations/0004_showcaselistpage.py index c1d6846b2..bb63f01b2 100644 --- a/recoco/apps/pages/migrations/0004_showcaselistpage.py +++ b/recoco/apps/pages/migrations/0004_showcaselistpage.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("pages", "0003_alter_showcasepage_content_and_more"), ("wagtailcore", "0093_uploadedfile"), diff --git a/recoco/apps/projects/forms.py b/recoco/apps/projects/forms.py index 01176b183..8b149d2f9 100644 --- a/recoco/apps/projects/forms.py +++ b/recoco/apps/projects/forms.py @@ -7,7 +7,6 @@ created : 2021-12-14 10:36:20 CEST """ - from django import forms from markdownx.fields import MarkdownxFormField diff --git a/recoco/apps/projects/management/commands/update_inactive_flag.py b/recoco/apps/projects/management/commands/update_inactive_flag.py index a37851366..522a5739d 100644 --- a/recoco/apps/projects/management/commands/update_inactive_flag.py +++ b/recoco/apps/projects/management/commands/update_inactive_flag.py @@ -8,7 +8,6 @@ created: 2024-01-22 16:39:27 CEST """ - import logging from datetime import timedelta diff --git a/recoco/apps/projects/migrations/0095_alter_document_uploaded_by.py b/recoco/apps/projects/migrations/0095_alter_document_uploaded_by.py index 2c78fc2d6..76e6e6f23 100644 --- a/recoco/apps/projects/migrations/0095_alter_document_uploaded_by.py +++ b/recoco/apps/projects/migrations/0095_alter_document_uploaded_by.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ ("projects", "0094_merge_20231207_1535"), migrations.swappable_dependency(settings.AUTH_USER_MODEL), diff --git a/recoco/apps/projects/migrations/0096_alter_note_site.py b/recoco/apps/projects/migrations/0096_alter_note_site.py index 179b9e984..cbf9ed5b6 100644 --- a/recoco/apps/projects/migrations/0096_alter_note_site.py +++ b/recoco/apps/projects/migrations/0096_alter_note_site.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("sites", "0002_alter_domain_unique"), ("projects", "0095_alter_document_uploaded_by"), diff --git a/recoco/apps/projects/migrations/0097_projectsite_project_project_sites.py b/recoco/apps/projects/migrations/0097_projectsite_project_project_sites.py index eeb8f096e..088948612 100644 --- a/recoco/apps/projects/migrations/0097_projectsite_project_project_sites.py +++ b/recoco/apps/projects/migrations/0097_projectsite_project_project_sites.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("projects", "0096_alter_note_site"), ("sites", "0002_alter_domain_unique"), diff --git a/recoco/apps/projects/migrations/0098_site_to_msite.py b/recoco/apps/projects/migrations/0098_site_to_msite.py index 6d645a158..cbde0e98f 100644 --- a/recoco/apps/projects/migrations/0098_site_to_msite.py +++ b/recoco/apps/projects/migrations/0098_site_to_msite.py @@ -21,7 +21,6 @@ def repopulate_sites_m2m(apps, schema_editor): class Migration(migrations.Migration): - dependencies = [ ("projects", "0097_projectsite_project_project_sites"), ] diff --git a/recoco/apps/projects/migrations/0099_alter_projectsite_and_more.py b/recoco/apps/projects/migrations/0099_alter_projectsite_and_more.py index 0a0cb27a9..4b6a43a08 100644 --- a/recoco/apps/projects/migrations/0099_alter_projectsite_and_more.py +++ b/recoco/apps/projects/migrations/0099_alter_projectsite_and_more.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - replaces = [ ("projects", "0099_alter_projectsite_unique_together"), ("projects", "0100_remove_project_sites"), diff --git a/recoco/apps/projects/migrations/0100_remove_projectsite_unique_origin_site_and_more.py b/recoco/apps/projects/migrations/0100_remove_projectsite_unique_origin_site_and_more.py index f07cbce97..d15f2d70e 100644 --- a/recoco/apps/projects/migrations/0100_remove_projectsite_unique_origin_site_and_more.py +++ b/recoco/apps/projects/migrations/0100_remove_projectsite_unique_origin_site_and_more.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("projects", "0099_alter_projectsite_and_more"), ("sites", "0002_alter_domain_unique"), diff --git a/recoco/apps/projects/migrations/0101_projectsite_unique_site_per_project.py b/recoco/apps/projects/migrations/0101_projectsite_unique_site_per_project.py index 192c3239d..6174d0c5f 100644 --- a/recoco/apps/projects/migrations/0101_projectsite_unique_site_per_project.py +++ b/recoco/apps/projects/migrations/0101_projectsite_unique_site_per_project.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("projects", "0100_remove_projectsite_unique_origin_site_and_more"), ] diff --git a/recoco/apps/projects/migrations/0102_alter_projectswitchtender_managers_and_more.py b/recoco/apps/projects/migrations/0102_alter_projectswitchtender_managers_and_more.py index 5d37f14f9..1270054d0 100644 --- a/recoco/apps/projects/migrations/0102_alter_projectswitchtender_managers_and_more.py +++ b/recoco/apps/projects/migrations/0102_alter_projectswitchtender_managers_and_more.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("projects", "0101_projectsite_unique_site_per_project"), diff --git a/recoco/apps/projects/migrations/0103_alter_project_location.py b/recoco/apps/projects/migrations/0103_alter_project_location.py index ff150ccea..30673fca1 100644 --- a/recoco/apps/projects/migrations/0103_alter_project_location.py +++ b/recoco/apps/projects/migrations/0103_alter_project_location.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("projects", "0102_alter_projectswitchtender_managers_and_more"), ] diff --git a/recoco/apps/projects/migrations/0104_projectsite_sent_by_projectsite_sent_from.py b/recoco/apps/projects/migrations/0104_projectsite_sent_by_projectsite_sent_from.py index aca5977c9..6e7b0c718 100644 --- a/recoco/apps/projects/migrations/0104_projectsite_sent_by_projectsite_sent_from.py +++ b/recoco/apps/projects/migrations/0104_projectsite_sent_by_projectsite_sent_from.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("sites", "0002_alter_domain_unique"), diff --git a/recoco/apps/projects/migrations/0105_project_is_diagnostic_done.py b/recoco/apps/projects/migrations/0105_project_is_diagnostic_done.py index b6eda51fb..cb1b74990 100644 --- a/recoco/apps/projects/migrations/0105_project_is_diagnostic_done.py +++ b/recoco/apps/projects/migrations/0105_project_is_diagnostic_done.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("projects", "0104_projectsite_sent_by_projectsite_sent_from"), ] diff --git a/recoco/apps/projects/migrations/0106_alter_userprojectstatus_managers.py b/recoco/apps/projects/migrations/0106_alter_userprojectstatus_managers.py index 24d13dc9c..16498d899 100644 --- a/recoco/apps/projects/migrations/0106_alter_userprojectstatus_managers.py +++ b/recoco/apps/projects/migrations/0106_alter_userprojectstatus_managers.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("projects", "0105_project_is_diagnostic_done"), ] diff --git a/recoco/apps/projects/tests/test_administration.py b/recoco/apps/projects/tests/test_administration.py index 1a2d174ca..4d3e20290 100644 --- a/recoco/apps/projects/tests/test_administration.py +++ b/recoco/apps/projects/tests/test_administration.py @@ -7,7 +7,6 @@ created: 2022-12-26 11:54:56 CEST """ - import pytest from actstream.models import action_object_stream from django.contrib.auth import models as auth_models @@ -303,7 +302,6 @@ def test_owner_cannot_be_removed_from_project_acl(request, client, project): def test_collaborator_can_remove_other_collaborator_from_project( request, client, project ): - collaborator = baker.make( auth_models.User, email="owner@ab.fr", @@ -329,7 +327,6 @@ def test_collaborator_can_remove_other_collaborator_from_project( @pytest.mark.django_db def test_collaborator_can_remove_herself_project(request, client, project): - with login(client) as user: assign_collaborator(user, project, is_owner=False) url = reverse( @@ -409,7 +406,6 @@ def test_unassigning_a_collaborator_cleans_notifications(request, client, projec @pytest.mark.django_db def test_staff_can_remove_collaborator_from_project(request, client, project): - collaborator = baker.make( auth_models.User, email="owner@ab.fr", diff --git a/recoco/apps/projects/tests/test_dashboards.py b/recoco/apps/projects/tests/test_dashboards.py index f97c19d9a..a4919d1bc 100644 --- a/recoco/apps/projects/tests/test_dashboards.py +++ b/recoco/apps/projects/tests/test_dashboards.py @@ -7,7 +7,6 @@ created: 2024-07-29 09:19:52 CEST """ - import pytest from django.urls import reverse diff --git a/recoco/apps/projects/tests/test_documents.py b/recoco/apps/projects/tests/test_documents.py index 7707360cf..12b105815 100644 --- a/recoco/apps/projects/tests/test_documents.py +++ b/recoco/apps/projects/tests/test_documents.py @@ -7,7 +7,6 @@ created: 2022-05-31 10:11:56 CEST """ - import pytest from actstream.models import action_object_stream from django.contrib.auth import models as auth_models diff --git a/recoco/apps/projects/tests/test_notes.py b/recoco/apps/projects/tests/test_notes.py index c91e54d77..d54ee1ee4 100644 --- a/recoco/apps/projects/tests/test_notes.py +++ b/recoco/apps/projects/tests/test_notes.py @@ -7,7 +7,6 @@ created: 2021-06-01 10:11:56 CEST """ - import notifications import pytest from actstream.models import action_object_stream diff --git a/recoco/apps/projects/tests/test_processors.py b/recoco/apps/projects/tests/test_processors.py index c630c48ca..01757e874 100644 --- a/recoco/apps/projects/tests/test_processors.py +++ b/recoco/apps/projects/tests/test_processors.py @@ -7,7 +7,6 @@ created: 2023-01-31 14:24:56 CEST """ - import pytest from django.contrib.sites.shortcuts import get_current_site from django.shortcuts import reverse diff --git a/recoco/apps/projects/tests/test_templatetags.py b/recoco/apps/projects/tests/test_templatetags.py index ee519afa4..72c2054d4 100644 --- a/recoco/apps/projects/tests/test_templatetags.py +++ b/recoco/apps/projects/tests/test_templatetags.py @@ -7,7 +7,6 @@ created: 2021-06-01 10:11:56 CEST """ - import pytest from django.contrib.auth import models as auth from django.contrib.sites.shortcuts import get_current_site diff --git a/recoco/apps/projects/tests/test_utils.py b/recoco/apps/projects/tests/test_utils.py index 0d0952845..9961fb8e6 100644 --- a/recoco/apps/projects/tests/test_utils.py +++ b/recoco/apps/projects/tests/test_utils.py @@ -6,6 +6,7 @@ authors: raphael.marvie@beta.gouv.fr, guillaume.libersat@beta.gouv.fr created: 2022-01-18 10:11:56 CEST """ + import pytest from django.conf import settings from django.contrib.auth import models as auth diff --git a/recoco/apps/projects/views/rest.py b/recoco/apps/projects/views/rest.py index a26c18f65..4a7573d2c 100644 --- a/recoco/apps/projects/views/rest.py +++ b/recoco/apps/projects/views/rest.py @@ -6,6 +6,7 @@ author : raphael.marvie@beta.gouv.fr,guillaume.libersat@beta.gouv.fr created : 2021-05-26 15:56:20 CEST """ + from __future__ import annotations from copy import copy diff --git a/recoco/apps/reminders/admin.py b/recoco/apps/reminders/admin.py index 90b573459..66023097a 100644 --- a/recoco/apps/reminders/admin.py +++ b/recoco/apps/reminders/admin.py @@ -39,7 +39,7 @@ def send_reminder(self, request, queryset): self.message_user( request, f'Rappel "{models.Reminder.KIND_CHOICES[reminder.kind][1]}"' - f"(B) envoyé à { reminder.project.owner }.", + f"(B) envoyé à {reminder.project.owner}.", messages.SUCCESS, ) @@ -52,7 +52,7 @@ def send_reminder(self, request, queryset): self.message_user( request, f'Rappel "{models.Reminder.KIND_CHOICES[reminder.kind][1]}"' - f"(C) envoyé à { reminder.project.owner }.", + f"(C) envoyé à {reminder.project.owner}.", messages.SUCCESS, ) diff --git a/recoco/apps/reminders/models.py b/recoco/apps/reminders/models.py index daf6fc68b..2970310f9 100644 --- a/recoco/apps/reminders/models.py +++ b/recoco/apps/reminders/models.py @@ -7,7 +7,6 @@ created : 2021-09-28 12:40:54 CEST """ - from django.contrib.auth import models as auth_models from django.contrib.contenttypes.fields import GenericRelation from django.contrib.sites.managers import CurrentSiteManager diff --git a/recoco/apps/resources/admin.py b/recoco/apps/resources/admin.py index 17441297d..6711a77f6 100644 --- a/recoco/apps/resources/admin.py +++ b/recoco/apps/resources/admin.py @@ -7,7 +7,6 @@ created: 2021-06-16 11:10:27 CEST """ - from csvexport.actions import csvexport from django.contrib import admin from reversion_compare.admin import CompareVersionAdmin diff --git a/recoco/apps/resources/migrations/0031_resource_imported_from.py b/recoco/apps/resources/migrations/0031_resource_imported_from.py index daf733d36..dd52d3a61 100644 --- a/recoco/apps/resources/migrations/0031_resource_imported_from.py +++ b/recoco/apps/resources/migrations/0031_resource_imported_from.py @@ -4,7 +4,6 @@ class Migration(migrations.Migration): - dependencies = [ ("resources", "0030_resource_site_origin"), ] diff --git a/recoco/apps/resources/models.py b/recoco/apps/resources/models.py index 0a3276a5a..bfdddcacf 100644 --- a/recoco/apps/resources/models.py +++ b/recoco/apps/resources/models.py @@ -6,6 +6,7 @@ authors: raphael.marvie@beta.gouv.fr, guillaume.libersat@beta.gouv.fr created: 2021-06-16 10:57:13 CEST """ + import datetime import reversion diff --git a/recoco/apps/resources/tests/test_views.py b/recoco/apps/resources/tests/test_views.py index 6d4f45b70..778b4322d 100644 --- a/recoco/apps/resources/tests/test_views.py +++ b/recoco/apps/resources/tests/test_views.py @@ -992,7 +992,7 @@ def test_embedded_resource_detail_contacts_to_display(request, client): contact = baker.make(Contact) - url = f"{reverse('resources-resource-detail-embeded',args=[resource.id])}?task_id={task.id}" + url = f"{reverse('resources-resource-detail-embeded', args=[resource.id])}?task_id={task.id}" with login(client) as user: response = client.get(url) diff --git a/recoco/apps/resources/urls.py b/recoco/apps/resources/urls.py index 5bc3aa0cb..0b3321119 100644 --- a/recoco/apps/resources/urls.py +++ b/recoco/apps/resources/urls.py @@ -7,7 +7,6 @@ created: 2021-06-16 11:05:44 CEST """ - from django.urls import path from . import views diff --git a/recoco/apps/survey/migrations/0034_question_slug.py b/recoco/apps/survey/migrations/0034_question_slug.py index 05ebd66dc..478070026 100644 --- a/recoco/apps/survey/migrations/0034_question_slug.py +++ b/recoco/apps/survey/migrations/0034_question_slug.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ ("survey", "0033_alter_session_project"), ] diff --git a/recoco/apps/survey/migrations/0036_alter_question_slug.py b/recoco/apps/survey/migrations/0036_alter_question_slug.py index a22419378..8e5e3b6c7 100644 --- a/recoco/apps/survey/migrations/0036_alter_question_slug.py +++ b/recoco/apps/survey/migrations/0036_alter_question_slug.py @@ -6,7 +6,6 @@ class Migration(migrations.Migration): - dependencies = [ ("survey", "0035_fill_question_slugs"), ] diff --git a/recoco/apps/survey/urls.py b/recoco/apps/survey/urls.py index 76db01f22..5f6cdbbbc 100644 --- a/recoco/apps/survey/urls.py +++ b/recoco/apps/survey/urls.py @@ -7,7 +7,6 @@ created : 2021-07-27 10:06:23 CEST """ - from django.urls import path from .views import edit, fill diff --git a/recoco/apps/tasks/admin.py b/recoco/apps/tasks/admin.py index 6e46a438d..426fb8645 100644 --- a/recoco/apps/tasks/admin.py +++ b/recoco/apps/tasks/admin.py @@ -7,7 +7,6 @@ created : 2021-05-26 13:55:23 CEST """ - from csvexport.actions import csvexport from django.contrib import admin, messages from django.urls import reverse diff --git a/recoco/apps/tasks/migrations/0004_alter_task_topic.py b/recoco/apps/tasks/migrations/0004_alter_task_topic.py index 209d8665c..684fa6e97 100644 --- a/recoco/apps/tasks/migrations/0004_alter_task_topic.py +++ b/recoco/apps/tasks/migrations/0004_alter_task_topic.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("projects", "0096_alter_note_site"), ("tasks", "0003_alter_task_options"), diff --git a/recoco/apps/tasks/migrations/0005_alter_task_resource.py b/recoco/apps/tasks/migrations/0005_alter_task_resource.py index a9d6b0d8a..0cd63ef8a 100644 --- a/recoco/apps/tasks/migrations/0005_alter_task_resource.py +++ b/recoco/apps/tasks/migrations/0005_alter_task_resource.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("resources", "0031_resource_imported_from"), ("tasks", "0004_alter_task_topic"), diff --git a/recoco/apps/tasks/migrations/0006_taskfollowup_contact_alter_task_contact.py b/recoco/apps/tasks/migrations/0006_taskfollowup_contact_alter_task_contact.py index f02a8ceb2..4902d4fdd 100644 --- a/recoco/apps/tasks/migrations/0006_taskfollowup_contact_alter_task_contact.py +++ b/recoco/apps/tasks/migrations/0006_taskfollowup_contact_alter_task_contact.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - dependencies = [ ("addressbook", "0011_contact_created_contact_modified_and_more"), ("tasks", "0005_alter_task_resource"), diff --git a/recoco/apps/tasks/urls.py b/recoco/apps/tasks/urls.py index b459bece3..6dea2b891 100644 --- a/recoco/apps/tasks/urls.py +++ b/recoco/apps/tasks/urls.py @@ -7,7 +7,6 @@ created : 2021-05-26 15:54:25 CEST """ - from django.urls import path from .views import ( diff --git a/recoco/apps/tasks/utils.py b/recoco/apps/tasks/utils.py index 3fba0ef17..62b10b7d7 100644 --- a/recoco/apps/tasks/utils.py +++ b/recoco/apps/tasks/utils.py @@ -8,7 +8,6 @@ """ - from django.urls import reverse from recoco import utils as uv_utils diff --git a/recoco/apps/training/models.py b/recoco/apps/training/models.py index 48ff568db..72913a032 100644 --- a/recoco/apps/training/models.py +++ b/recoco/apps/training/models.py @@ -9,7 +9,6 @@ Inspired by django-gamification (https://github.com/mattjegan/django-gamification/) """ - from django.contrib.auth import models as auth_models from django.contrib.sites import models as site_models from django.contrib.sites.managers import CurrentSiteManager diff --git a/recoco/apps/training/rest.py b/recoco/apps/training/rest.py index a04043c72..10b75fcf0 100644 --- a/recoco/apps/training/rest.py +++ b/recoco/apps/training/rest.py @@ -7,7 +7,6 @@ created : 2021-05-26 15:56:20 CEST """ - from django.http import Http404 from django.utils import timezone from rest_framework import generics, permissions, status, viewsets diff --git a/recoco/apps/training/templatetags/training.py b/recoco/apps/training/templatetags/training.py index 02796cc3e..19644f4dc 100644 --- a/recoco/apps/training/templatetags/training.py +++ b/recoco/apps/training/templatetags/training.py @@ -7,7 +7,6 @@ created: 2023-08-21 14:54:48 CEST """ - from django import template from django.utils import timezone diff --git a/recoco/apps/training/tests/test_models.py b/recoco/apps/training/tests/test_models.py index b3366ecf4..c46304234 100644 --- a/recoco/apps/training/tests/test_models.py +++ b/recoco/apps/training/tests/test_models.py @@ -7,7 +7,6 @@ created: 2023-08-21 12:07:45 CEST """ - import pytest from django.utils import timezone from model_bakery import baker diff --git a/recoco/apps/training/tests/test_rest.py b/recoco/apps/training/tests/test_rest.py index b0b305478..78e4e658a 100644 --- a/recoco/apps/training/tests/test_rest.py +++ b/recoco/apps/training/tests/test_rest.py @@ -7,7 +7,6 @@ created: 2023-06-20 14:10:36 CEST """ - import pytest from django.contrib.auth import models as auth_models from django.contrib.sites import models as site_models diff --git a/recoco/apps/webhook/migrations/0001_initial.py b/recoco/apps/webhook/migrations/0001_initial.py index a5c56c9c1..0e1dae411 100644 --- a/recoco/apps/webhook/migrations/0001_initial.py +++ b/recoco/apps/webhook/migrations/0001_initial.py @@ -5,7 +5,6 @@ class Migration(migrations.Migration): - initial = True dependencies = [ diff --git a/recoco/settings/common.py b/recoco/settings/common.py index f88a1f1d7..984d8aa74 100644 --- a/recoco/settings/common.py +++ b/recoco/settings/common.py @@ -507,9 +507,7 @@ ] METRICS_MATERIALIZED_VIEWS_SQL_DIR = BASE_DIR / "apps/metrics/sql_queries" -METRICS_MATERIALIZED_VIEWS_OWNER_OVERRIDES = ( - {} -) # specific rules for the schema owner per site +METRICS_MATERIALIZED_VIEWS_OWNER_OVERRIDES = {} # specific rules for the schema owner per site METRICS_MATERIALIZED_VIEWS_OWNER_TPL = os.getenv( "METRICS_MATERIALIZED_VIEWS_OWNER_TPL", default=None ) diff --git a/requirements.txt b/requirements.txt index 192ee3f52..1d17a3d8e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -91,21 +91,6 @@ beautifulsoup4==4.12.3 \ billiard==4.2.1 \ --hash=sha256:12b641b0c539073fc8d3f5b8b7be998956665c4233c7c1fcd66a7e677c4fb36f \ --hash=sha256:40b59a4ac8806ba2c2369ea98d876bc6108b051c227baffd928c644d15d8f3cb -black==25.1.0 \ - --hash=sha256:030b9759066a4ee5e5aca28c3c77f9c64789cdd4de8ac1df642c40b708be6171 \ - --hash=sha256:172b1dbff09f86ce6f4eb8edf9dede08b1fce58ba194c87d7a4f1a5aa2f5b3c2 \ - --hash=sha256:1e2978f6df243b155ef5fa7e558a43037c3079093ed5d10fd84c43900f2d8ecc \ - --hash=sha256:33496d5cd1222ad73391352b4ae8da15253c5de89b93a80b3e2c8d9a19ec2666 \ - --hash=sha256:3b48735872ec535027d979e8dcb20bf4f70b5ac75a8ea99f127c106a7d7aba9f \ - --hash=sha256:4b60580e829091e6f9238c848ea6750efed72140b91b048770b64e74fe04908b \ - --hash=sha256:8f0b18a02996a836cc9c9c78e5babec10930862827b1b724ddfe98ccf2f2fe4f \ - --hash=sha256:95e8176dae143ba9097f351d174fdaf0ccd29efb414b362ae3fd72bf0f710717 \ - --hash=sha256:96c1c7cd856bba8e20094e36e0f948718dc688dba4a9d78c3adde52b9e6c2299 \ - --hash=sha256:a22f402b410566e2d1c950708c77ebf5ebd5d0d88a6a2e87c86d9fb48afa0d18 \ - --hash=sha256:a39337598244de4bae26475f77dda852ea00a93bd4c728e09eacd827ec929df0 \ - --hash=sha256:afebb7098bfbc70037a053b91ae8437c3857482d3a690fefc03e9ff7aa9a5fd3 \ - --hash=sha256:bce2e264d59c91e52d8000d507eb20a9aca4a778731a08cfff7e5ac4a4bb7096 \ - --hash=sha256:ea0213189960bda9cf99be5b8c8ce66bb054af5e9e861249cd23471bd7b0b3ba bleach==6.2.0 \ --hash=sha256:117d9c6097a7c3d22fd578fcd8d35ff1e125df6736f554da4e432fdd63f31e5e \ --hash=sha256:123e894118b8a599fd80d3ec1a6d4cc7ce4e5882b1317a7e1ba69b56e95f991f @@ -764,9 +749,6 @@ multimethod==1.7 \ mwclient==0.11.0 \ --hash=sha256:27914a307cb4539fd49a16d634c9c777c0de0976b3af9225bd95d4657bfd4d74 \ --hash=sha256:2bb7696f3703243eb33514ab162d7f6076dcedd011be90682936046c5e34fd06 -mypy-extensions==1.0.0 \ - --hash=sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d \ - --hash=sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782 natsort==8.4.0 \ --hash=sha256:45312c4a0e5507593da193dedd04abb1469253b601ecaf63445ad80f0a1ea581 \ --hash=sha256:4732914fb471f56b5cce04d7bae6f164a592c7712e1c85f9ef585e197299521c @@ -814,9 +796,6 @@ parsimonious==0.10.0 \ parso==0.8.4 \ --hash=sha256:a418670a20291dacd2dddc80c377c5c3791378ee1e8d12bffc35420643d43f18 \ --hash=sha256:eb3a7b58240fb99099a345571deecc0f9540ea5f4dd2fe14c2a99d6b281ab92d -pathspec==0.12.1 \ - --hash=sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08 \ - --hash=sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712 peewee==3.17.9 \ --hash=sha256:fe15cd001758e324c8e3ca8c8ed900e7397c2907291789e1efc383e66b9bc7a8 pexpect==4.9.0 ; sys_platform != 'emscripten' and sys_platform != 'win32' \ diff --git a/scripts/onboarding2edl.py b/scripts/onboarding2edl.py index 50fe39887..dd7f7e0ae 100644 --- a/scripts/onboarding2edl.py +++ b/scripts/onboarding2edl.py @@ -9,7 +9,6 @@ def run(): - for sc in SiteConfiguration.objects.all(): print(f"\n************ {sc.site} ************\n\n") onboarding = sc.onboarding diff --git a/uv.lock b/uv.lock index bf0e5f091..b87cb07df 100644 --- a/uv.lock +++ b/uv.lock @@ -1,4 +1,5 @@ version = 1 +revision = 1 requires-python = ">=3.11" resolution-markers = [ "python_full_version >= '3.13'", @@ -244,34 +245,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/30/da/43b15f28fe5f9e027b41c539abc5469052e9d48fd75f8ff094ba2a0ae767/billiard-4.2.1-py3-none-any.whl", hash = "sha256:40b59a4ac8806ba2c2369ea98d876bc6108b051c227baffd928c644d15d8f3cb", size = 86766 }, ] -[[package]] -name = "black" -version = "25.1.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "click" }, - { name = "mypy-extensions" }, - { name = "packaging" }, - { name = "pathspec" }, - { name = "platformdirs" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/94/49/26a7b0f3f35da4b5a65f081943b7bcd22d7002f5f0fb8098ec1ff21cb6ef/black-25.1.0.tar.gz", hash = "sha256:33496d5cd1222ad73391352b4ae8da15253c5de89b93a80b3e2c8d9a19ec2666", size = 649449 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7e/4f/87f596aca05c3ce5b94b8663dbfe242a12843caaa82dd3f85f1ffdc3f177/black-25.1.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a39337598244de4bae26475f77dda852ea00a93bd4c728e09eacd827ec929df0", size = 1614372 }, - { url = "https://files.pythonhosted.org/packages/e7/d0/2c34c36190b741c59c901e56ab7f6e54dad8df05a6272a9747ecef7c6036/black-25.1.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:96c1c7cd856bba8e20094e36e0f948718dc688dba4a9d78c3adde52b9e6c2299", size = 1442865 }, - { url = "https://files.pythonhosted.org/packages/21/d4/7518c72262468430ead45cf22bd86c883a6448b9eb43672765d69a8f1248/black-25.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:bce2e264d59c91e52d8000d507eb20a9aca4a778731a08cfff7e5ac4a4bb7096", size = 1749699 }, - { url = "https://files.pythonhosted.org/packages/58/db/4f5beb989b547f79096e035c4981ceb36ac2b552d0ac5f2620e941501c99/black-25.1.0-cp311-cp311-win_amd64.whl", hash = "sha256:172b1dbff09f86ce6f4eb8edf9dede08b1fce58ba194c87d7a4f1a5aa2f5b3c2", size = 1428028 }, - { url = "https://files.pythonhosted.org/packages/83/71/3fe4741df7adf015ad8dfa082dd36c94ca86bb21f25608eb247b4afb15b2/black-25.1.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4b60580e829091e6f9238c848ea6750efed72140b91b048770b64e74fe04908b", size = 1650988 }, - { url = "https://files.pythonhosted.org/packages/13/f3/89aac8a83d73937ccd39bbe8fc6ac8860c11cfa0af5b1c96d081facac844/black-25.1.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1e2978f6df243b155ef5fa7e558a43037c3079093ed5d10fd84c43900f2d8ecc", size = 1453985 }, - { url = "https://files.pythonhosted.org/packages/6f/22/b99efca33f1f3a1d2552c714b1e1b5ae92efac6c43e790ad539a163d1754/black-25.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:3b48735872ec535027d979e8dcb20bf4f70b5ac75a8ea99f127c106a7d7aba9f", size = 1783816 }, - { url = "https://files.pythonhosted.org/packages/18/7e/a27c3ad3822b6f2e0e00d63d58ff6299a99a5b3aee69fa77cd4b0076b261/black-25.1.0-cp312-cp312-win_amd64.whl", hash = "sha256:ea0213189960bda9cf99be5b8c8ce66bb054af5e9e861249cd23471bd7b0b3ba", size = 1440860 }, - { url = "https://files.pythonhosted.org/packages/98/87/0edf98916640efa5d0696e1abb0a8357b52e69e82322628f25bf14d263d1/black-25.1.0-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:8f0b18a02996a836cc9c9c78e5babec10930862827b1b724ddfe98ccf2f2fe4f", size = 1650673 }, - { url = "https://files.pythonhosted.org/packages/52/e5/f7bf17207cf87fa6e9b676576749c6b6ed0d70f179a3d812c997870291c3/black-25.1.0-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:afebb7098bfbc70037a053b91ae8437c3857482d3a690fefc03e9ff7aa9a5fd3", size = 1453190 }, - { url = "https://files.pythonhosted.org/packages/e3/ee/adda3d46d4a9120772fae6de454c8495603c37c4c3b9c60f25b1ab6401fe/black-25.1.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:030b9759066a4ee5e5aca28c3c77f9c64789cdd4de8ac1df642c40b708be6171", size = 1782926 }, - { url = "https://files.pythonhosted.org/packages/cc/64/94eb5f45dcb997d2082f097a3944cfc7fe87e071907f677e80788a2d7b7a/black-25.1.0-cp313-cp313-win_amd64.whl", hash = "sha256:a22f402b410566e2d1c950708c77ebf5ebd5d0d88a6a2e87c86d9fb48afa0d18", size = 1442613 }, - { url = "https://files.pythonhosted.org/packages/09/71/54e999902aed72baf26bca0d50781b01838251a462612966e9fc4891eadd/black-25.1.0-py3-none-any.whl", hash = "sha256:95e8176dae143ba9097f351d174fdaf0ccd29efb414b362ae3fd72bf0f710717", size = 207646 }, -] - [[package]] name = "bleach" version = "6.2.0" @@ -2180,15 +2153,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b0/ad/2bf4551a9f9c5c360b990ce6119edd717e0f28bb332a71921f4aa52889dc/mwclient-0.11.0-py3-none-any.whl", hash = "sha256:27914a307cb4539fd49a16d634c9c777c0de0976b3af9225bd95d4657bfd4d74", size = 33274 }, ] -[[package]] -name = "mypy-extensions" -version = "1.0.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/98/a4/1ab47638b92648243faf97a5aeb6ea83059cc3624972ab6b8d2316078d3f/mypy_extensions-1.0.0.tar.gz", hash = "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782", size = 4433 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", size = 4695 }, -] - [[package]] name = "natsort" version = "8.4.0" @@ -2390,15 +2354,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c6/ac/dac4a63f978e4dcb3c6d3a78c4d8e0192a113d288502a1216950c41b1027/parso-0.8.4-py2.py3-none-any.whl", hash = "sha256:a418670a20291dacd2dddc80c377c5c3791378ee1e8d12bffc35420643d43f18", size = 103650 }, ] -[[package]] -name = "pathspec" -version = "0.12.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/ca/bc/f35b8446f4531a7cb215605d100cd88b7ac6f44ab3fc94870c120ab3adbf/pathspec-0.12.1.tar.gz", hash = "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712", size = 51043 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/cc/20/ff623b09d963f88bfde16306a54e12ee5ea43e9b597108672ff3a408aad6/pathspec-0.12.1-py3-none-any.whl", hash = "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", size = 31191 }, -] - [[package]] name = "peewee" version = "3.17.9" @@ -3183,7 +3138,6 @@ dependencies = [ [package.dev-dependencies] dev = [ - { name = "black" }, { name = "coverage" }, { name = "django-coverage-plugin" }, { name = "django-debug-toolbar" }, @@ -3286,7 +3240,6 @@ requires-dist = [ [package.metadata.requires-dev] dev = [ - { name = "black", specifier = ">=25.1.0" }, { name = "coverage", specifier = "==7.4.1" }, { name = "django-coverage-plugin", specifier = ">=3.1.0" }, { name = "django-debug-toolbar", specifier = "==4.3.0" },