aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2019-08-19 17:25:25 +0100
committerDave Arter <davea@mysociety.org>2019-08-29 14:35:50 +0100
commit60ade4cc7c4981bc05ab5959ef5d3fc1ca41851c (patch)
tree0041ed6d16395e4b401d1406064bd7592147c720 /perllib/FixMyStreet/App/Controller/Report/New.pm
parenta5336887af2d62ad0accdb39da3d22192a312c07 (diff)
Make sure anonymous reports are marked anon irrespective of permissions
There was a small bug where the 'default_to_body' permission would override the 'report anonymously' button when staff users were adding reports to the site. The result of this was that the name of the anonymous user record would be shown. No harm done, as that user's name would likely be set to "Anonymous user" in config, but it resulted in reports pages showing the slightly odd wording along the lines of: Reported in the Bin bags category by Anonymous user at 14:57 today This commit ensures the contributing_as_body flag is mutually exclusive with the 'report_anonymously' request parameter.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index be812c040..8f1f08d2e 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -949,6 +949,8 @@ sub process_report : Private {
my $anon_button = $c->cobrand->allow_anonymous_reports eq 'button' && $c->get_param('report_anonymously');
if ($anon_button) {
$c->stash->{contributing_as_anonymous_user} = 1;
+ $c->stash->{contributing_as_body} = undef;
+ $c->stash->{contributing_as_another_user} = undef;
}
# set some simple bool values (note they get inverted)