aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-02-01 11:40:38 +0000
committerDave Arter <davea@mysociety.org>2017-02-15 17:36:40 +0000
commit0b1bc26366811481b322c322f2414514bb7c2166 (patch)
tree6e2827a4958dcd48f2aa97871d2bf426d1ce3fc2 /perllib/FixMyStreet/App/Controller/Report.pm
parent71e4186cefa356f240870cd5edf0e15b27e5e044 (diff)
Allow cobrands to control which states affect reputation
Rather than assigning +1 to a user's reputation every time a report is inspected, this allows cobrands to specify which states should increment or decrement the reputation value when a report is inspected. The default behaviour is for reputation to never be changed, but the Oxfordshire cobrand will increment the reputation when a report is marked as 'action scheduled'. For mysociety/fixmystreetforcouncils#119
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index ad26ecf84..5c34630c4 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -377,7 +377,9 @@ sub inspect : Private {
unless ($problem->get_extra_metadata('inspected')) {
$problem->set_extra_metadata( inspected => 1 );
$c->forward( '/admin/log_edit', [ $problem->id, 'problem', 'inspected' ] );
- $reputation_change = 1;
+ my $state = $problem->state;
+ $reputation_change = 1 if $c->cobrand->reputation_increment_states->{$state};
+ $reputation_change = -1 if $c->cobrand->reputation_decrement_states->{$state};
}
}
}