aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/DB/Result
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/DB/Result')
-rw-r--r--perllib/FixMyStreet/DB/Result/Body.pm8
-rw-r--r--perllib/FixMyStreet/DB/Result/User.pm5
2 files changed, 9 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Body.pm b/perllib/FixMyStreet/DB/Result/Body.pm
index c04c117ae..37164c990 100644
--- a/perllib/FixMyStreet/DB/Result/Body.pm
+++ b/perllib/FixMyStreet/DB/Result/Body.pm
@@ -134,6 +134,7 @@ __PACKAGE__->rabx_column('extra');
use Moo;
use namespace::clean;
+use FixMyStreet::MapIt;
with 'FixMyStreet::Roles::Translatable',
'FixMyStreet::Roles::Extra';
@@ -182,10 +183,9 @@ sub first_area_children {
my $cobrand = $self->result_source->schema->cobrand;
- my %params = ( type => $cobrand->area_types_children );
- $params{generation} = FixMyStreet->config('MAPIT_GENERATION')
- if FixMyStreet->config('MAPIT_GENERATION');
- my $children = mySociety::MaPit::call('area/children', $body_area->area_id, %params);
+ my $children = FixMyStreet::MapIt::call('area/children', $body_area->area_id,
+ type => $cobrand->area_types_children,
+ );
return $children;
}
diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm
index bf74e6934..546867c34 100644
--- a/perllib/FixMyStreet/DB/Result/User.pm
+++ b/perllib/FixMyStreet/DB/Result/User.pm
@@ -292,6 +292,11 @@ sub body {
return $self->from_body->name;
}
+sub moderating_user_name {
+ my $self = shift;
+ return $self->body || _('an administrator');
+}
+
=head2 belongs_to_body
$belongs_to_body = $user->belongs_to_body( $bodies );