Skip to content

Commit

Permalink
fix: missing filter in ProjectPhaseSerializer.get_has_hearings
Browse files Browse the repository at this point in the history
The sibling method get_hearings was changed to filter visible hearings
but this was never reflected in has_hearings. Changing to have
consistent behaviour.

Refs: KER-249
  • Loading branch information
voneiden committed Oct 28, 2024
1 parent 13701fd commit 7d2e515
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion democracy/views/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ def __init__(self, *args, **kwargs):
self.partial = True

def get_has_hearings(self, project_phase):
return project_phase.hearings.exists()
return filter_by_hearing_visible(
project_phase.hearings.with_unpublished(), self.context.get("request"), hearing_lookup=""
).exists()

def get_hearings(self, project_phase):
return [
Expand Down

0 comments on commit 7d2e515

Please sign in to comment.