Bug 27205: Improve logic readability in conditional
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
c913bd7d69
commit
85c2526085
1 changed files with 4 additions and 7 deletions
|
@ -257,11 +257,9 @@ sub edit {
|
|||
|
||||
my $pickup_library_id = $body->{pickup_library_id};
|
||||
|
||||
unless (
|
||||
!defined $pickup_library_id
|
||||
or $hold->is_pickup_location_valid(
|
||||
{ library_id => $pickup_library_id }
|
||||
)
|
||||
if (
|
||||
defined $pickup_library_id
|
||||
and not $hold->is_pickup_location_valid({ library_id => $pickup_library_id })
|
||||
)
|
||||
{
|
||||
return $c->render(
|
||||
|
@ -272,8 +270,7 @@ sub edit {
|
|||
);
|
||||
}
|
||||
|
||||
$pickup_library_id = $hold->branchcode
|
||||
unless defined $pickup_library_id;
|
||||
$pickup_library_id //= $hold->branchcode;
|
||||
my $priority = $body->{priority} // $hold->priority;
|
||||
# suspended_until can also be set to undef
|
||||
my $suspended_until = exists $body->{suspended_until} ? $body->{suspended_until} : $hold->suspend_until;
|
||||
|
|
Loading…
Reference in a new issue