Skip to content

Commit

Permalink
Update pre-commit. Run on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed Aug 27, 2024
1 parent aa66c65 commit fb68b62
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.8.0
hooks:
- id: black
language_version: python3
Expand Down
1 change: 1 addition & 0 deletions config/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# For Docker env (and debug toolbar in particular)
import socket


_, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS = [ip[: ip.rfind(".")] + ".1" for ip in ips] + ["127.0.0.1"]

Expand Down
6 changes: 3 additions & 3 deletions lemarche/siaes/management/commands/import_esat_from_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def handle(self, *args, **options): # noqa C901
"siret": siret,
"contact_email": email,
"contact_phone": phone,
"employees_insertion_count": int(employees_count)
if employees_count and employees_count != "#N/D"
else None,
"employees_insertion_count": (
int(employees_count) if employees_count and employees_count != "#N/D" else None
),
"employees_insertion_count_last_updated": timezone.now(),
"import_raw_object": data.copy(),
"kind": siae_constants.KIND_ESAT,
Expand Down
1 change: 1 addition & 0 deletions lemarche/utils/templatetags/theme_inclusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Exist also in the base code of C1 :
https://github.com/betagouv/itou/blob/master/itou/utils/templatetags/theme_inclusion.py
"""

from django import template
from django.templatetags.static import static
from django.utils.safestring import mark_safe
Expand Down
2 changes: 1 addition & 1 deletion lemarche/www/dashboard_siaes/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from django.views.generic.base import RedirectView

from lemarche.www.dashboard_siaes.views import (
SiaeEditActivitiesDeleteView,
SiaeEditActivitiesCreateView,
SiaeEditActivitiesDeleteView,
SiaeEditActivitiesEditView,
SiaeEditActivitiesView,
SiaeEditContactView,
Expand Down
13 changes: 8 additions & 5 deletions lemarche/www/siaes/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1032,11 +1032,14 @@ def test_search_query_no_result(self):
mock_siaes_similarity_search.assert_called_once()

def test_search_query_with_results(self):
with mock.patch(
"lemarche.utils.apis.api_elasticsearch.siaes_similarity_search"
) as mock_siaes_similarity_search, mock.patch(
"lemarche.utils.apis.api_elasticsearch.siaes_similarity_search_with_city"
) as mock_siaes_similarity_search_with_city:
with (
mock.patch(
"lemarche.utils.apis.api_elasticsearch.siaes_similarity_search"
) as mock_siaes_similarity_search,
mock.patch(
"lemarche.utils.apis.api_elasticsearch.siaes_similarity_search_with_city"
) as mock_siaes_similarity_search_with_city,
):
mock_siaes_similarity_search.return_value = [self.siae_two.pk, self.siae_three.pk, self.siae_four.pk]
url = self.url + "?semantic_q=entretien espace vert&id_semantic_city_name=&semantic_city="
response = self.client.get(url)
Expand Down
6 changes: 3 additions & 3 deletions lemarche/www/tenders/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ class Meta:

def __init__(self, tender_survey_transactioned_answer=None, *args, **kwargs):
super().__init__(*args, **kwargs)
self.fields[
"survey_transactioned_answer"
].label = "Avez-vous contractualisé avec un prestataire trouvé via le Marché de l'inclusion ?"
self.fields["survey_transactioned_answer"].label = (
"Avez-vous contractualisé avec un prestataire trouvé via le Marché de l'inclusion ?"
)
self.fields["survey_transactioned_amount"].label = "Quel est le montant de la transaction ? (facultatif)"
self.fields["survey_transactioned_feedback"].label = "Partagez-nous votre retour d'expérience (facultatif)"
self.fields["survey_transactioned_feedback"].widget.attrs.update(
Expand Down

0 comments on commit fb68b62

Please sign in to comment.