Skip to content

Commit

Permalink
Merge pull request #4061 from GeotrekCE/modifs_on_prestataires
Browse files Browse the repository at this point in the history
🐛 fix: change label filter intervention contractors and filter null value on project contractors detail view (ref #3820)
  • Loading branch information
juggler31 authored Apr 12, 2024
2 parents cba44cb + f36d080 commit aa572f7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ CHANGELOG
- Fix OptionalRangeFilter and CustomDateFromToRangeFilter labels translation (fixes #3852)
- Fix crash on migrate when db username or dbname contains dash
- Fix Intervention end date should only be mandatory in last step of Suricate Workflow (refs #3825)"
- Change label filter intervention contractors and filter null value on project contractors detail view (#3820)

**Improvements**

- Add `report` model on Intervention filters in module list (#3972)

**Documentation**

Expand All @@ -22,6 +20,7 @@ CHANGELOG
**Improvements**

- Remove unused `postgres` volume in docker compose file for production
- Add `report` model on Intervention filters in module list (#3972)


2.104.2 (2024-04-04)
Expand Down
2 changes: 1 addition & 1 deletion geotrek/maintenance/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class ProjectFilterSet(StructureRelatedFilterSet):
district = ProjectIntersectionFilterDistrict(label=_('District'), lookup_expr='intersects', required=False)
area_type = ProjectIntersectionFilterRestrictedAreaType(label=_('Restricted area type'), lookup_expr='intersects', required=False)
area = ProjectIntersectionFilterRestrictedArea(label=_('Restricted area'), lookup_expr='intersects', required=False)
contractors = ModelMultipleChoiceFilter(label=_("Intervention contractors"), queryset=Contractor.objects.all(), method='filter_contractors')
contractors = ModelMultipleChoiceFilter(label=_("Contractors"), queryset=Contractor.objects.all(), method='filter_contractors')

class Meta(StructureRelatedFilterSet.Meta):
model = Project
Expand Down
2 changes: 1 addition & 1 deletion geotrek/maintenance/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def interventions_csv_display(self):
@property
def intervention_contractors(self):
return self.interventions.aggregate(
intervention_contractors=ArrayAgg('contractors__contractor', distinct=True))['intervention_contractors']
intervention_contractors=ArrayAgg('contractors__contractor', distinct=True, filter=Q(contractors__isnull=False)))['intervention_contractors']

@classproperty
def intervention_contractors_verbose_name(cls):
Expand Down

0 comments on commit aa572f7

Please sign in to comment.