From 848244b982e254d80fcc37b2856e600172c514fb Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Wed, 18 Apr 2018 13:56:28 -0300 Subject: [PATCH] Bug 20568: (QA follow-up) Make sure client_id and secret are not overwritten on store Signed-off-by: Tomas Cohen Arazi Signed-off-by: Julian Maurice --- Koha/ApiKey.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Koha/ApiKey.pm b/Koha/ApiKey.pm index 08b661be02..716dd0efc2 100644 --- a/Koha/ApiKey.pm +++ b/Koha/ApiKey.pm @@ -49,8 +49,10 @@ sub store { my ( $uuid, $uuidstring ); - $self->client_id($self->_generate_unused_uuid('client_id')); - $self->secret($self->_generate_unused_uuid('secret')); + $self->client_id($self->_generate_unused_uuid('client_id')) + unless $self->client_id; + $self->secret($self->_generate_unused_uuid('secret')) + unless $self->secret; return $self->SUPER::store(); } -- 2.14.2