Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/project-view
Browse files Browse the repository at this point in the history
  • Loading branch information
pyDez committed Jan 17, 2025
2 parents 25635dc + c54b970 commit 906ff79
Show file tree
Hide file tree
Showing 12 changed files with 1,500 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ jobs:
- name: Checkout Code Repository
uses: actions/checkout@v3

- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/[email protected]
with:
python-version: 3.9
python-version: 3.12.3

- name: Install python dependencies
run: pip install -r requirements/local.txt
Expand Down
15 changes: 8 additions & 7 deletions envergo/hedges/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,15 @@ def hedges_to_remove(self):
def length_to_remove(self):
return round(sum(h.length for h in self.hedges_to_remove()))

def hedges_to_remove_pac(self):
return [
h
for h in self.hedges_to_remove()
if h.is_on_pac and h.hedge_type != "alignement"
]

def lineaire_detruit_pac(self):
return round(
sum(
h.length
for h in self.hedges_to_remove()
if h.is_on_pac and h.hedge_type != "alignement"
)
)
return round(sum(h.length for h in self.hedges_to_remove_pac()))

def lineaire_detruit_pac_including_alignement(self):
return round(sum(h.length for h in self.hedges_to_remove() if h.is_on_pac))
Expand Down

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions envergo/moulinette/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,18 @@ class ConfigHaie(ConfigBase):
default=list,
)

demarches_simplifiees_city_id = models.CharField(
'Identifiant de la "commune principale" dans Démarches Simplifiées',
blank=True,
max_length=64,
)

demarches_simplifiees_pacage_id = models.CharField(
'Identifiant du "numéro de PACAGE" dans Démarches Simplifiées',
blank=True,
max_length=64,
)

def __str__(self):
return self.department.get_department_display()

Expand Down
5 changes: 5 additions & 0 deletions envergo/pages/templatetags/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,8 @@ def to_list(item):
def add_string(arg1, arg2):
"""concatenate arg1 & arg2"""
return str(arg1) + str(arg2)


@register.filter
def is_type(value, type_name):
return type(value).__name__ == type_name
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import datetime
import logging
from datetime import datetime, timedelta
from textwrap import dedent

import requests
Expand All @@ -23,10 +23,10 @@ class Command(BaseCommand):
def handle(self, *args, **options):
# get all the dossier updated in the last hour
api_url = settings.DEMARCHES_SIMPLIFIEE["GRAPHQL_API_URL"]
now_utc = datetime.utcnow()
now_utc = datetime.datetime.now(datetime.UTC)
# NB: if you change this timedelta, you should also change the cron job frequency
one_hour_ago_utc = now_utc - timedelta(hours=1)
iso8601_one_hour_ago = one_hour_ago_utc.isoformat() + "Z"
one_hour_ago_utc = now_utc - datetime.timedelta(hours=1)
iso8601_one_hour_ago = one_hour_ago_utc.isoformat()

current_site = Site.objects.get(domain=settings.ENVERGO_HAIE_DOMAIN)
handled_demarches = []
Expand Down
Loading

0 comments on commit 906ff79

Please sign in to comment.