aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/Update.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-03-15 13:10:41 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-03-20 09:14:33 +0000
commit79bbd50afd3b02144cd0e1441b54a329e5e0c04f (patch)
tree2ed095f37bbc13bcfc921e9ce3b2f81e5a61fb6c /perllib/FixMyStreet/App/Controller/Report/Update.pm
parent8d69e4d3f20db5d122d711673346c4ce9adc4242 (diff)
Store contributed-as data.
Store if the report/update was created by someone using the contributed-as dropdown, and use that information to perhaps not send report-sent emails.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 99eae8659..9d97688c5 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -444,9 +444,17 @@ sub save_update : Private {
if ( $c->cobrand->never_confirm_updates ) {
$update->user->update_or_insert;
$update->confirm();
- } elsif ( $c->forward('/report/new/created_as_someone_else', [ $update->problem->bodies_str ]) ) {
- # If created on behalf of someone else, we automatically confirm it,
- # but we don't want to update the user account
+ # If created on behalf of someone else, we automatically confirm it,
+ # but we don't want to update the user account
+ } elsif ($c->stash->{contributing_as_another_user}) {
+ $update->set_extra_metadata( contributed_as => 'another_user');
+ $update->set_extra_metadata( contributed_by => $c->user->id );
+ $update->confirm();
+ } elsif ($c->stash->{contributing_as_body}) {
+ $update->set_extra_metadata( contributed_as => 'body' );
+ $update->confirm();
+ } elsif ($c->stash->{contributing_as_anonymous_user}) {
+ $update->set_extra_metadata( contributed_as => 'anonymous_user' );
$update->confirm();
} elsif ( !$update->user->in_storage ) {
# User does not exist.