Skip to content

Commit

Permalink
[PP-1650] Allows SirsiDynix Horizon Auth Provider users to reset Adob…
Browse files Browse the repository at this point in the history
…e IDs.
  • Loading branch information
dbernstein committed Sep 3, 2024
1 parent c80f10a commit d805fac
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
17 changes: 13 additions & 4 deletions src/palace/manager/api/sirsidynix_authentication_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,20 @@ def remote_patron_lookup(
with a session_token already setup within it.
This method also checks all the reasons that a patron may be blocked for.
"""
# if the patron data object is not authenticated just pass it back after ensuring the
# complete flag is set to False
if (
not hasattr(patron_or_patrondata, "session_token")
or patron_or_patrondata.session_token is None
):
patron_or_patrondata.complete = False
return patron_or_patrondata

# We cannot do a remote lookup without a session token
if not isinstance(patron_or_patrondata, SirsiDynixPatronData):
return None
elif not patron_or_patrondata.session_token:
return None
# if :
# return None
# elif not patron_or_patrondata.session_token:
# return None

patrondata = patron_or_patrondata
# Pull and parse the basic patron information
Expand Down
12 changes: 6 additions & 6 deletions tests/manager/api/test_sirsidynix_auth_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,15 +292,15 @@ def test_remote_patron_lookup_bad_patrondata(
):
# Test no session token
provider = sirsi_auth_fixture.provider_mocked_api().provider
assert (
provider.remote_patron_lookup(
SirsiDynixPatronData(permanent_id="xxxx", session_token=None)
)
is None
patron_data = provider.remote_patron_lookup(
SirsiDynixPatronData(permanent_id="xxxx", session_token=None)
)

assert not patron_data.complete

# Test incorrect patrondata type
assert provider.remote_patron_lookup(PatronData(permanent_id="xxxx")) is None
patron_data = provider.remote_patron_lookup(PatronData(permanent_id="xxxx"))
assert not patron_data.complete

def test_remote_patron_lookup_bad_patron_read_data(
self, sirsi_auth_fixture: SirsiAuthFixture
Expand Down

0 comments on commit d805fac

Please sign in to comment.