Skip to content

Commit

Permalink
Merge pull request #6305 from jimchamp/6304/bug/remove-old-loan-statu…
Browse files Browse the repository at this point in the history
…s-calls

Prevent loan/waiting list status calls with old-style username format
  • Loading branch information
mekarpeles authored Mar 17, 2022
2 parents 2a96fc6 + 599d4a2 commit d3abda1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion openlibrary/core/lending.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,6 @@ def get_loans_of_user(user_key):
loandata = web.ctx.site.store.values(type='/type/loan', name='user', value=user_key)
loans = [Loan(d) for d in loandata] + (
_get_ia_loans_of_user(account.itemname)
+ _get_ia_loans_of_user(userkey2userid(user_key))
)
return loans

Expand Down
4 changes: 1 addition & 3 deletions openlibrary/core/waitinglist.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,7 @@ def find(cls, user_key, identifier, itemname=None):
if not itemname:
account = OpenLibraryAccount.get(key=user_key)
itemname = account.itemname
result = cls.query(userid=itemname, identifier=identifier) or cls.query(
userid=lending.userkey2userid(user_key), identifier=identifier
)
result = cls.query(userid=itemname, identifier=identifier)
if result:
return result[0]

Expand Down

0 comments on commit d3abda1

Please sign in to comment.