diff options
Diffstat (limited to 'perllib/FixMyStreet/DB/Result')
-rw-r--r-- | perllib/FixMyStreet/DB/Result/Problem.pm | 11 | ||||
-rw-r--r-- | perllib/FixMyStreet/DB/Result/User.pm | 2 |
2 files changed, 2 insertions, 11 deletions
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index ec1534fe9..203e72fae 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -681,16 +681,7 @@ alphabetical order of name. sub response_priorities { my $self = shift; - return $self->result_source->schema->resultset('ResponsePriority')->search( - { - 'me.body_id' => $self->bodies_str_ids, - 'contact.category' => [ $self->category, undef ], - }, - { - order_by => 'name', - join => { 'contact_response_priorities' => 'contact' }, - } - ); + return $self->result_source->schema->resultset('ResponsePriority')->for_bodies($self->bodies_str_ids, $self->category); } # returns true if the external id is the council's ref, i.e., useful to publish it diff --git a/perllib/FixMyStreet/DB/Result/User.pm b/perllib/FixMyStreet/DB/Result/User.pm index 028394795..f4e5144f8 100644 --- a/perllib/FixMyStreet/DB/Result/User.pm +++ b/perllib/FixMyStreet/DB/Result/User.pm @@ -268,7 +268,7 @@ sub has_permission_to { my ($self, $permission_type, $body_ids) = @_; return 1 if $self->is_superuser; - return 0 unless $body_ids; + return 0 if !$body_ids || (ref $body_ids && !@$body_ids); my $permission = $self->user_body_permissions->find({ permission_type => $permission_type, |