From 782f785bb39c25312cfbc422f1d5bec35a0ee727 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 25 Apr 2022 10:43:00 -0300 Subject: [PATCH] Bug 29924: (QA follow-up) Remove password_expiration_date from API Signed-off-by: Tomas Cohen Arazi --- Koha/Patron.pm | 1 + api/v1/swagger/definitions/patron.yaml | 7 ------- api/v1/swagger/paths/patrons.yaml | 5 ----- t/db_dependent/api/v1/patrons.t | 5 ----- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/Koha/Patron.pm b/Koha/Patron.pm index 35809b180d5..30f61a77f62 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -1951,6 +1951,7 @@ sub to_api_mapping { altcontactsurname => 'altcontact_surname', altcontactstate => 'altcontact_state', altcontactzipcode => 'altcontact_postal_code', + password_expiration_date => undef, primary_contact_method => undef, secret => undef, auth_method => undef, diff --git a/api/v1/swagger/definitions/patron.yaml b/api/v1/swagger/definitions/patron.yaml index 6cad2ec85e4..256430ae6c8 100644 --- a/api/v1/swagger/definitions/patron.yaml +++ b/api/v1/swagger/definitions/patron.yaml @@ -359,13 +359,6 @@ properties: - number - "null" description: Balance of the patron's account - password_expiration_date: - type: - - string - - "null" - format: date - readOnly: true - description: day a patron's password expires and must be changed/reset additionalProperties: false required: - surname diff --git a/api/v1/swagger/paths/patrons.yaml b/api/v1/swagger/paths/patrons.yaml index 43fc8fa6359..5164cb2858d 100644 --- a/api/v1/swagger/paths/patrons.yaml +++ b/api/v1/swagger/paths/patrons.yaml @@ -189,11 +189,6 @@ description: Case insensitive search on expiry_date required: false type: string - - name: password_expiration_date - in: query - description: Case insensitive search on password_expiration_date - required: false - type: string - name: incorrect_address in: query description: Search on incorrect_address diff --git a/t/db_dependent/api/v1/patrons.t b/t/db_dependent/api/v1/patrons.t index ebcd83a0d5c..3d23b60372a 100755 --- a/t/db_dependent/api/v1/patrons.t +++ b/t/db_dependent/api/v1/patrons.t @@ -342,7 +342,6 @@ subtest 'add() tests' => sub { delete $newpatron->{patron_id}; delete $newpatron->{restricted}; delete $newpatron->{anonymized}; - delete $newpatron->{password_expiration_date}; # Create a library just to make sure its ID doesn't exist on the DB my $library_to_delete = $builder->build_object({ class => 'Koha::Libraries' }); @@ -396,7 +395,6 @@ subtest 'add() tests' => sub { delete $newpatron->{patron_id}; delete $newpatron->{restricted}; delete $newpatron->{anonymized}; - delete $newpatron->{password_expiration_date}; $patron_to_delete->delete; # Set a date field @@ -622,7 +620,6 @@ subtest 'update() tests' => sub { delete $newpatron->{patron_id}; delete $newpatron->{restricted}; delete $newpatron->{anonymized}; - delete $newpatron->{password_expiration_date}; $t->put_ok("//$userid:$password@/api/v1/patrons/-1" => json => $newpatron) ->status_is(404) @@ -701,7 +698,6 @@ subtest 'update() tests' => sub { $newpatron->{patron_id} = $unauthorized_patron->to_api->{patron_id}; $newpatron->{restricted} = $unauthorized_patron->to_api->{restricted}; $newpatron->{anonymized} = $unauthorized_patron->to_api->{anonymized}; - $newpatron->{password_expiration_date} = $unauthorized_patron->to_api->{password_expiration_date}; my $got = $result->tx->res->json; my $updated_on_got = delete $got->{updated_on}; @@ -733,7 +729,6 @@ subtest 'update() tests' => sub { delete $newpatron->{patron_id}; delete $newpatron->{restricted}; delete $newpatron->{anonymized}; - delete $newpatron->{password_expiration_date}; # attempt to update $authorized_patron->flags( 2**4 )->store; # borrowers flag = 4 -- 2.34.1