diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-02-14 09:22:43 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-02-14 09:22:43 +0000 |
commit | a494edfb9b8b971ef825782123d4422c73288b75 (patch) | |
tree | c079d022f384918eea3d70732e5069f1e760677e /perllib/FixMyStreet/App/Controller | |
parent | f661c0f41eb30b024c17888889b7d725ab412ddf (diff) | |
parent | 90ba1eec155c8b785b52a842fb8157aacf53d555 (diff) |
Merge branch 'allow-anon-on-some-categories'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 6f6428089..a3df4aa82 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -272,9 +272,11 @@ sub by_category_ajax_data : Private { } my $non_public = $c->stash->{non_public_categories}->{$category}; + my $anon_button = ($c->cobrand->allow_anonymous_reports($category) eq 'button'); my $body = { bodies => [ map { $_->name } @bodies ], $non_public ? ( non_public => JSON->true ) : (), + $anon_button ? ( allow_anonymous => JSON->true ) : (), }; if ( $c->stash->{category_extras}->{$category} && @{ $c->stash->{category_extras}->{$category} } >= 1 ) { @@ -984,7 +986,7 @@ sub process_report : Private { $c->stash->{contributing_as_anonymous_user} = $user->contributing_as('anonymous_user', $c, $c->stash->{bodies}); } # This is also done in process_user, but is needed here for anonymous() just below - my $anon_button = $c->cobrand->allow_anonymous_reports eq 'button' && $c->get_param('report_anonymously'); + my $anon_button = $c->cobrand->allow_anonymous_reports($params{category}) eq 'button' && $c->get_param('report_anonymously'); if ($anon_button) { $c->stash->{contributing_as_anonymous_user} = 1; $c->stash->{contributing_as_body} = undef; |