diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index a0bcdb4d0..806fc8391 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -221,16 +221,13 @@ sub admin_type { my $body = $c->user->from_body; $c->stash->{body} = $body; - my $parent = $body->parent; - my $children = $body->bodies->count; - my $type; + my $parent = $body->parent; if (!$parent) { $type = 'super'; - } elsif ($parent && $children) { - $type = 'dm'; - } elsif ($parent) { - $type = 'sdm'; + } else { + my $grandparent = $parent->parent; + $type = $grandparent ? 'sdm' : 'dm'; } $c->stash->{admin_type} = $type; |