aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/Update.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2017-08-09 16:54:15 +0100
committerStruan Donald <struan@exo.org.uk>2017-08-16 10:42:23 +0100
commit25a9d0223668ccefc4b4dd83f5f0f18a37a4353c (patch)
treea4927c481a3b83085c07bbedda721fa8342141c4 /perllib/FixMyStreet/App/Controller/Report/Update.pm
parentf066a3937216e0cc4dc0413efc8e8f90e79b6066 (diff)
enable body users to add problem updates anonymously
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/Update.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm
index 59171f97b..068f393f2 100644
--- a/perllib/FixMyStreet/App/Controller/Report/Update.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm
@@ -128,7 +128,7 @@ sub process_user : Private {
$update->user( $user );
# Just in case, make sure the user will have a name
- if ($c->stash->{contributing_as_body}) {
+ if ($c->stash->{contributing_as_body} or $c->stash->{contributing_as_anonymous_user}) {
$user->name($user->from_body->name) unless $user->name;
}
@@ -277,9 +277,13 @@ sub process_update : Private {
$update->mark_open($params{reopen} ? 1 : 0);
$c->stash->{contributing_as_body} = $c->user_exists && $c->user->contributing_as('body', $c, $update->problem->bodies_str_ids);
+ $c->stash->{contributing_as_anonymous_user} = $c->user_exists && $c->user->contributing_as('anonymous_user', $c, $update->problem->bodies_str_ids);
if ($c->stash->{contributing_as_body}) {
$update->name($c->user->from_body->name);
$update->anonymous(0);
+ } elsif ($c->stash->{contributing_as_anonymous_user}) {
+ $update->name($c->user->from_body->name);
+ $update->anonymous(1);
} else {
$update->name($name);
$update->anonymous($c->get_param('may_show_name') ? 0 : 1);