aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm19
1 files changed, 11 insertions, 8 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index e4e82f091..a41aeb6ea 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -1300,9 +1300,17 @@ sub save_user_and_report : Private {
if ( $c->cobrand->never_confirm_reports ) {
$report->user->update_or_insert;
$report->confirm();
- } elsif ( $c->forward('created_as_someone_else', [ $c->stash->{bodies} ]) ) {
- # 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}) {
+ $report->set_extra_metadata( contributed_as => 'another_user');
+ $report->set_extra_metadata( contributed_by => $c->user->id );
+ $report->confirm();
+ } elsif ($c->stash->{contributing_as_body}) {
+ $report->set_extra_metadata( contributed_as => 'body' );
+ $report->confirm();
+ } elsif ($c->stash->{contributing_as_anonymous_user}) {
+ $report->set_extra_metadata( contributed_as => 'anonymous_user' );
$report->confirm();
} elsif ( !$report->user->in_storage ) {
# User does not exist.
@@ -1342,11 +1350,6 @@ sub save_user_and_report : Private {
return 1;
}
-sub created_as_someone_else : Private {
- my ($self, $c, $bodies) = @_;
- return $c->stash->{contributing_as_another_user} || $c->stash->{contributing_as_body} || $c->stash->{contributing_as_anonymous_user};
-}
-
=head2 generate_map
Add the html needed to for the map to the stash.