diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 12 |
2 files changed, 8 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index cd1436598..7fb11d6f4 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -31,6 +31,7 @@ sub begin : Private { if ($c->cobrand->moniker eq 'zurich') { $c->detach( '/auth/redirect' ) unless $c->user_exists; $c->detach( '/auth/redirect' ) unless $c->user->from_body; + $c->cobrand->admin_type(); } } diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index d39e017f7..faeed1cf0 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -65,7 +65,7 @@ sub admin_type { sub admin { my $self = shift; my $c = $self->{c}; - my $type = $self->admin_type(); + my $type = $c->stash->{admin_type}; if ($type eq 'dm') { $c->stash->{template} = 'admin/index-dm.html'; @@ -113,14 +113,16 @@ sub admin { sub admin_report_edit { my $self = shift; my $c = $self->{c}; - my $type = $self->admin_type(); + my $type = $c->stash->{admin_type}; my $problem = $c->stash->{problem}; my $body = $c->stash->{body}; - my %allowed_bodies = map { $_->id => 1 } ( $body->bodies->all, $body ); - $c->detach( '/page_error_404_not_found' ) - unless $allowed_bodies{$problem->bodies_str}; + if ($type ne 'super') { + my %allowed_bodies = map { $_->id => 1 } ( $body->bodies->all, $body ); + $c->detach( '/page_error_404_not_found' ) + unless $allowed_bodies{$problem->bodies_str}; + } if ($type eq 'super') { |