fix for wrong col used in query
This commit is contained in:
@@ -74,8 +74,8 @@ sub search_aliases {
|
|||||||
else {
|
else {
|
||||||
$q = "\%$q\%" if $q !~ m/\%/;
|
$q = "\%$q\%" if $q !~ m/\%/;
|
||||||
$clause = [
|
$clause = [
|
||||||
'me.ip::text' => { '-ilike' => $q },
|
'me.dns' => { '-ilike' => $q },
|
||||||
'device_ips.alias::text' => { '-ilike' => $q },
|
'device_ips.dns' => { '-ilike' => $q },
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,14 +90,13 @@ get '/device' => sub {
|
|||||||
my $q = param('q');
|
my $q = param('q');
|
||||||
my $dev = schema('netdisco')->resultset('Device')->single({
|
my $dev = schema('netdisco')->resultset('Device')->single({
|
||||||
-or => [
|
-or => [
|
||||||
ip => $q,
|
'me.ip::text' => $q,
|
||||||
dns => $q,
|
'me.dns' => $q,
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
if (! $dev) {
|
if (!defined $dev) {
|
||||||
redirect uri_for('/', {nosuchdevice => 1});
|
return redirect uri_for('/', {nosuchdevice => 1});
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
params->{'tab'} ||= 'details';
|
params->{'tab'} ||= 'details';
|
||||||
|
|||||||
Reference in New Issue
Block a user