Skip to content

Commit

Permalink
Merge branch 'main' into prod
Browse files Browse the repository at this point in the history
  • Loading branch information
thibault committed Jan 29, 2025
2 parents 3acc436 + 9f2e279 commit 8c4145c
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 14 deletions.
2 changes: 2 additions & 0 deletions config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,3 +435,5 @@
"amenagement": "[email protected]",
"haie": "[email protected]",
}

HAIE_FAQ_URL = "https://www.notion.so/Guichet-unique-de-la-haie-propos-17afe5fe476680a9abe6c4bdf5301abb"
2 changes: 2 additions & 0 deletions config/urls_amenagement.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.conf import settings
from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import SetPasswordForm
from django.urls import include, path
Expand Down Expand Up @@ -48,6 +49,7 @@
subject_template_name="amenagement/emails/password_reset_subject.txt",
email_template_name="amenagement/emails/password_reset.txt",
html_email_template_name="amenagement/emails/password_reset.html",
from_email=settings.SITE_FROM_EMAIL["amenagement"],
),
name="password_reset",
),
Expand Down
2 changes: 2 additions & 0 deletions config/urls_haie.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from django.conf import settings
from django.contrib.auth import views as auth_views
from django.contrib.auth.forms import SetPasswordForm
from django.urls import include, path
Expand Down Expand Up @@ -44,6 +45,7 @@
subject_template_name="haie/emails/password_reset_subject.txt",
email_template_name="haie/emails/password_reset.txt",
html_email_template_name="haie/emails/password_reset.html",
from_email=settings.SITE_FROM_EMAIL["haie"],
),
name="password_reset",
),
Expand Down
3 changes: 1 addition & 2 deletions e2e/evaluations/request.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ test('User can request an evaluation', async ({ page }) => {
await page.getByLabel('Menu principal').getByRole('link', { name: 'Demander un avis réglementaire' }).click();
await page.locator('p').filter({ hasText: 'Commencer la demande Durée : 1 min' }).getByRole('link').click();
await page.getByLabel('Address of the project Type').click();
await page.getByLabel('Address of the project Type').fill('Vue');
await page.getByRole('option', { name: 'Vue 44, Loire-Atlantique,' }).click();
await page.getByLabel('Address of the project Type').fill('44640 Vue');
await page.getByPlaceholder('15 caractères commençant par').click();
await page.getByPlaceholder('15 caractères commençant par').fill('PA1234567981011');
await page.getByLabel('Project description, comments').click();
Expand Down
7 changes: 3 additions & 4 deletions envergo/hedges/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,9 @@ def __str__(self):
def __iter__(self):
return iter(self.hedges())

def get_bounding_box(self):
"""Return the bounding box of the whole hedge set."""
def get_bounding_box(self, hedges):
"""Return the bounding box of the given hedge set."""

hedges = self.hedges()
min_x, min_y, max_x, max_y = hedges[0].geometry.bounds
for hedge in hedges[1:]:
x0, y0, x1, y1 = hedge.geometry.bounds
Expand Down Expand Up @@ -237,7 +236,7 @@ def get_hedge_species(self):
def get_local_species_codes(self):
"""Return species names that are known to live here."""

bbox = self.get_bounding_box()
bbox = self.get_bounding_box(self.hedges_to_remove())
zones = Zone.objects.filter(geometry__intersects=bbox).filter(
map__map_type="species"
)
Expand Down
7 changes: 4 additions & 3 deletions envergo/moulinette/templatetags/moulinette.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ def get_display_result(regulation):
RESULTS.non_soumis,
RESULTS.non_concerne,
RESULTS.non_disponible,
RESULTS.derogation_inventaire,
RESULTS.derogation_simplifiee,
]

return regulation.result if regulation.result not in other_results else "autre"
Expand All @@ -320,13 +318,16 @@ def group_regulations_for_display(moulinette):
result_cascade = [
RESULTS.interdit,
RESULTS.soumis,
RESULTS.derogation_simplifiee,
RESULTS.derogation_inventaire,
"autre",
]

regulations_list.sort(key=lambda reg: result_cascade.index(get_display_result(reg)))

# Group the regulations by their result
return {
grouped = {
key: list(group)
for key, group in groupby(regulations_list, key=get_display_result)
}
return grouped
2 changes: 1 addition & 1 deletion envergo/static/sass/project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ article {

&.probability-soumis,
&.probability-systematique,
&.probability-derogation,
&.probability-derogation_inventaire,
&.probability-derogation_simplifiee,
&.probability-4 {
background-color: #ffb7a5;
Expand Down
6 changes: 6 additions & 0 deletions envergo/templates/haie/_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@
<ul class="fr-nav__list">
<li class="fr-nav__item">{% menu_item 'home' "Accueil" %}</li>
<li class="fr-nav__item">{% pilote_departments_menu %}</li>
<li class="fr-nav__item">
<a class="fr-nav__link"
href="{{ HAIE_FAQ_URL }}"
target="_blank"
rel="noopener external">Questions fréquentes</a>
</li>
</ul>
</nav>
</div>
Expand Down
6 changes: 4 additions & 2 deletions envergo/templates/haie/_slim_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@
<div class="fr-header__tools-links">
<ul class="fr-btns-group">
<li>
<div class="fr-btn">&nbsp;</div>
<a class="fr-btn"
href="{{ HAIE_FAQ_URL }}"
target="_blank"
rel="noopener external">Questions fréquentes</a>
</li>
<!-- This blank entry enforces the correct height -->
</ul>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion envergo/templates/haie/moulinette/result_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<h3>Réglementations interdisant le projet</h3>
{% elif result == "soumis" and moulinette.result != "soumis" %}
<h3>Autres réglementations concernant le projet</h3>
{% elif result == "soumis" %}
{% elif result != "autre" %}
<h3>Réglementations concernant le projet</h3>
{% else %}
<h3>Autres réglementations</h3>
Expand Down
2 changes: 1 addition & 1 deletion envergo/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ def get(self, request, *args, **kwargs):
user.access_amenagement = True
elif site_literal == "haie":
user.access_haie = True
send_new_account_notification.delay(user.id)
user.save()
send_new_account_notification.delay(user.id)

return super().get(request, *args, **kwargs)

Expand Down
1 change: 1 addition & 0 deletions envergo/utils/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def settings_context(_request):
"ENV_NAME": settings.ENV_NAME,
"CRISP_CHATBOX_ENABLED": chatbox_enabled,
"CRISP_WEBSITE_ID": crisp_website_id,
"HAIE_FAQ_URL": settings.HAIE_FAQ_URL,
}


Expand Down

0 comments on commit 8c4145c

Please sign in to comment.