Skip to content

Commit

Permalink
fixup! Show number of agreements in top level summary
Browse files Browse the repository at this point in the history
  • Loading branch information
ajparsons committed Mar 25, 2024
1 parent d165116 commit 91a5886
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions classes/Divisions.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,8 @@ public function getMemberDivisionDetails($strong_only = false) {
$args
);

$policies_list = new \MySociety\TheyWorkForYou\Policies();
$allowed_policies = $policies_list->getPolicyIDs();

foreach ($q as $row) {
$policy_id = $row['policy_id'];
// deleted policies may still be in the database - ignore them
if (!in_array($policy_id, $allowed_policies)) {
continue;
}

if (!array_key_exists($policy_id, $policy_divisions)) {
$summary = array(
Expand Down Expand Up @@ -307,6 +300,8 @@ public function getMemberDivisionDetails($strong_only = false) {
}

// for each key in $policy_divisions, we want to add agreement information

$policies_list = new \MySociety\TheyWorkForYou\Policies();
foreach ($policy_divisions as $policy_id => &$summary) {
$agreement_details = $this->member->member_agreements($policy_id, HOUSE_TYPE_COMMONS, $policies_list );
$summary["agreements_for"] = 0;
Expand Down

0 comments on commit 91a5886

Please sign in to comment.