Skip to content

Commit

Permalink
patron information: fix summary field
Browse files Browse the repository at this point in the history
Co-Authored-by: Lauren-D <[email protected]>
  • Loading branch information
lauren-d committed Dec 19, 2022
1 parent 5e66053 commit 12d1403
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 21 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@

Changes
=======
Version 0.6.19 (released 2022-12-19)

**Bug fix:**

* Fixes patron information summary field.

Version 0.6.18 (released 2022-12-16)

**Implemented enhancements:**
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
# The short X.Y version.

# The full version, including alpha/beta/rc tags.
release = '0.6.18'
release = '0.6.19'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
1 change: 0 additions & 1 deletion invenio_sip2/actions/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ def execute(self, message, client):
field=optional_field,
field_value=patron_account.get(optional_field.name)
)

# check patron password
patron_password = message.get_field_value('patron_pwd')
if patron_password:
Expand Down
8 changes: 4 additions & 4 deletions invenio_sip2/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def __init__(self, patron_id, institution_id, patron_name='',
self['charged_items'] = []
self['fine_items'] = []
self['recall_items'] = []
self['unavailable_items'] = []
self['unavailable_hold_items'] = []
self['screen_messages'] = []

# optional properties
Expand Down Expand Up @@ -624,7 +624,7 @@ class SelfcheckSummary:
'charged_items',
'fine_items',
'recall_items',
'unavailable_items',
'unavailable_hold_items',
]

def __init__(self, text):
Expand All @@ -635,8 +635,8 @@ def __init__(self, text):
self.charged_items = decode_char_to_bool(text[2])
self.fine_items = decode_char_to_bool(text[3])
self.recall_items = decode_char_to_bool(text[4])
self.unavailable_items = decode_char_to_bool(text[5])
self.unavailable_hold_items = decode_char_to_bool(text[5])

def is_needed(self, key):
"""Check if the given information is needed."""
return hasattr(self, key)
return getattr(self, key, False)
2 changes: 1 addition & 1 deletion invenio_sip2/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

"""Version information for Invenio-SIP2."""

__version__ = '0.6.18'
__version__ = '0.6.19'
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "invenio-sip2"
version = "0.6.18"
version = "0.6.19"
description = "Invenio module that add a SIP2 communication for library self-check service"
readme = "README.rst"
authors = ["Laurent Dubois <[email protected]>"]
Expand Down
26 changes: 13 additions & 13 deletions tests/test_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_sip2_actions_interface(app):
@mock.patch('invenio_sip2.actions.actions.selfcheck_login_handler',
mock.MagicMock(return_value={'authenticated': False}))
def test_sip2_login_failed(app, dummy_client, failed_login_message):
"""Test invenio-sip2 login action failed."""
"""Test login action failed."""

response = current_sip2.sip2.execute(
Message(request=failed_login_message),
Expand All @@ -56,7 +56,7 @@ def test_sip2_login_failed(app, dummy_client, failed_login_message):


def test_sip2_login(app, dummy_client, login_message):
"""Test invenio-sip2 login action."""
"""Test login action."""
response = current_sip2.sip2.execute(
Message(request=login_message),
client=dummy_client
Expand All @@ -65,7 +65,7 @@ def test_sip2_login(app, dummy_client, login_message):


def test_sip2_system_status(app, dummy_client, system_status_message):
"""Test invenio-sip2 system status action."""
"""Test system status action."""
response = current_sip2.sip2.execute(
Message(request=system_status_message),
client=dummy_client
Expand All @@ -74,7 +74,7 @@ def test_sip2_system_status(app, dummy_client, system_status_message):


def test_patron_enable(app, dummy_client, enable_patron_message):
"""Test invenio-sip2 patron enable action."""
"""Test patron enable action."""
response = current_sip2.sip2.execute(
Message(request=enable_patron_message),
client=dummy_client
Expand All @@ -83,7 +83,7 @@ def test_patron_enable(app, dummy_client, enable_patron_message):


def test_patron_status(app, dummy_client, patron_status_message):
"""Test invenio-sip2 patron enable action."""
"""Test patron status action."""
response = current_sip2.sip2.execute(
Message(request=patron_status_message),
client=dummy_client
Expand All @@ -92,7 +92,7 @@ def test_patron_status(app, dummy_client, patron_status_message):


def test_patron_information(app, dummy_client, patron_information_message):
"""Test invenio-sip2 patron enable action."""
"""Test patron information action."""
response = current_sip2.sip2.execute(
Message(request=patron_information_message),
client=dummy_client
Expand All @@ -106,7 +106,7 @@ def test_patron_information(app, dummy_client, patron_information_message):


def test_item_information(app, dummy_client, item_information_message):
"""Test invenio-sip2 patron enable action."""
"""Test patron enable action."""
response = current_sip2.sip2.execute(
Message(request=item_information_message),
client=dummy_client
Expand All @@ -115,7 +115,7 @@ def test_item_information(app, dummy_client, item_information_message):


def test_checkout(app, dummy_client, checkout_message):
"""Test invenio-sip2 checkout action."""
"""Test checkout action."""
response = current_sip2.sip2.execute(
Message(request=checkout_message),
client=dummy_client
Expand All @@ -124,7 +124,7 @@ def test_checkout(app, dummy_client, checkout_message):


def test_checkin(app, dummy_client, checkin_message):
"""Test invenio-sip2 checkin action."""
"""Test checkin action."""
response = current_sip2.sip2.execute(
Message(request=checkin_message),
client=dummy_client
Expand All @@ -133,7 +133,7 @@ def test_checkin(app, dummy_client, checkin_message):


def test_hold(app, dummy_client, create_hold_message):
"""Test invenio-sip2 hold action."""
"""Test hold action."""
response = current_sip2.sip2.execute(
Message(request=create_hold_message),
client=dummy_client
Expand All @@ -142,7 +142,7 @@ def test_hold(app, dummy_client, create_hold_message):


def test_renew(app, dummy_client, renew_message):
"""Test invenio-sip2 renew action."""
"""Test renew action."""
response = current_sip2.sip2.execute(
Message(request=renew_message),
client=dummy_client
Expand All @@ -151,7 +151,7 @@ def test_renew(app, dummy_client, renew_message):


def test_fee_paid(app, dummy_client, fee_paid_message):
"""Test invenio-sip2 checkin action."""
"""Test checkin action."""
response = current_sip2.sip2.execute(
Message(request=fee_paid_message),
client=dummy_client
Expand All @@ -160,7 +160,7 @@ def test_fee_paid(app, dummy_client, fee_paid_message):


def test_end_patron_session(app, dummy_client, end_patron_session_message):
"""Test invenio-sip2 patron enable action."""
"""Test patron enable action."""
# IMPORTANT NOTE:
# this test needs to be run last, because during this test,
# the patron session is deleted
Expand Down

0 comments on commit 12d1403

Please sign in to comment.