Bug 21178: Add Koha::Patron::set_password
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 16 Aug 2018 10:13:56 +0000 (07:13 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Sat, 13 Oct 2018 10:29:44 +0000 (07:29 -0300)
commit4a7c6fa10ce19414f2157ca6a1fe4d06a2a14c4c
treeeba3463d1f47b3f4ee5019ca8e0b5806779d575f
parentc28d62ce91f3cfdf4384529d11bd896faa6ddbcd
Bug 21178: Add Koha::Patron::set_password

This patch introduces the 'set_password' method for Koha::Patron
objects. The main point is to make password changing atomic
(update_password touches the userid on the DB, which should be done
carefully with better error handling, and it is done there only for
legacy backwards compatibility).

A follow-up bug will make the codebase use this instead of
update_password, and use a proper method for changing the userid if
required.

To test:
- Apply this patchset
- Run:
  $ kshell
 k$ prove t/db_dependent/Koha/Patrons.t
=> SUCCESS: Tests pass!
- Sign off! :-D

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Patron.pm