Skip to content

Commit

Permalink
Merge branch 'develop' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mhucka committed Jun 4, 2021
2 parents 23c1aad + 0e59b8c commit 857672f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change log for DIBS

## Version 0.4.1

* Fix issue #85: remove email address from server log message printed during status checks


## Version 0.4.0

This version implements an interface for starting the IIIF image processing workflow. This is implemented in the `dibs/templates/list.tpl` template file, with an an addition to `settings.ini`. It interacts with the "available" column in the `/list` page.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ In order to use DIBS at another institution (other than [Caltech](https://www.ca
2. A **web server** to host DIBS. The current version of DIBS has only been tested with Apache2 on Linux (specifically, Ubuntu 20) and macOS (specifically 10.13, High Sierra). DIBS comes with a WSGI adapter file and sample config file for Apache, but it should be possible to run DIBS in other WSGI-compliant servers.
3. An **authentication layer**. For authentication, DIBS assumes that the web server takes care of user authentication in such a way that DIBS is behind the authentication layer and all users who can reach the DIBS pages are allowed to view content. DIBS only implements checks to distinguish between regular users versus staff who are allowed to access restricted pages. For the authentication layer, at Caltech we use the [Shibboleth](https://en.wikipedia.org/wiki/Shibboleth_Single_Sign-on_architecture) single sign-on system, but it is possible to use other schemes. The installation and configuration of a single sign-on system depends on the specifics of a given institution, and are not described here.
4. Modification to the metadata retrieval code. We strove to limit dependencies on external systems, but the interface for staff to add items to DIBS requires looking up some limited metadata based on an item's barcode, and lacking a universal scheme or ILS interface to do that, we had to hard code the access. Thankfully, this is limited to just a few lines in [`server.py`](dibs/server.py). We currently use TIND at Caltech, so unless you also use TIND, you will need to modify the TIND-specific lines in that file.
5. Modification to the HTML templates to change the branding. The template files in [dibs/templates](dibs/templates) are specific to Caltech, and will need to be edited to suit another installation. (We are open to making the branding customization easier and would welcome a [pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for suitable changes!)
5. Modification to the HTML templates to change the branding. The template files in [`dibs/templates`](dibs/templates) are specific to Caltech, and will need to be edited to suit another installation. (We are open to making the branding customization easier and would welcome a [pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests) for suitable changes!)


## Installation
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"codeRepository": "https://github.com/caltechlibrary/dibs",
"issueTracker": "https://github.com/caltechlibrary/dibs/issues",
"license": "https://github.com/caltechlibrary/dibs/blob/master/LICENSE",
"version": "0.4.0",
"version": "0.4.1",
"author": [
{
"@type": "Person",
Expand Down
2 changes: 1 addition & 1 deletion dibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# | by the Makefile. Manual changes to these values will be lost. |
# ╰────────────────────── Notice ── Notice ── Notice ─────────────────────╯

__version__ = '0.4.0'
__version__ = '0.4.1'
__description__ = 'An implementation of Controlled Digital Lending'
__url__ = 'https://github.com/caltechlibrary/dibs'
__author__ = 'Michael Hucka, Robert S. Doiel, Tommy Keswick, Stephen Davison'
Expand Down
3 changes: 2 additions & 1 deletion dibs/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ def has_role(person, role):


def role_to_redirect(role):
'''given a user role (including an empty string) return the target path for a redirect'''
'''Given a user role (including an empty string), return the target
path for a redirect.'''
if role in _role_table:
return _role_table[role]
else:
Expand Down
9 changes: 5 additions & 4 deletions dibs/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,13 +513,14 @@ def loan_availability(user, barcode):
explanation = ''
when_available = None
loan = Loan.get_or_none(Loan.user == user, Loan.item == item)
who = anon(user)
if loan:
if loan.state == 'active':
log(f'{user} already has {barcode} on loan')
log(f'{who} already has {barcode} on loan')
status = Status.LOANED_BY_USER
explanation = 'This item is currently on digital loan to you.'
else:
log(f'{user} had a loan on {barcode} too recently')
log(f'{who} had a loan on {barcode} too recently')
status = Status.TOO_SOON
explanation = ('Your loan period has ended and it is too soon '
'after the last time you borrowed it.')
Expand All @@ -528,7 +529,7 @@ def loan_availability(user, barcode):
loan = Loan.get_or_none(Loan.user == user, Loan.state == 'active')
if loan:
other = loan.item
log(f'{user} has a loan on {other.barcode} that ends at {loan.end_time}')
log(f'{who} has a loan on {other.barcode} that ends at {loan.end_time}')
status = Status.USER_HAS_OTHER
author = shorten(other.author, width = 50, placeholder = ' …')
explanation = ('You have another item currently on loan'
Expand All @@ -543,7 +544,7 @@ def loan_availability(user, barcode):
explanation = 'All available copies are currently on loan.'
when_available = min(loan.end_time for loan in loans)
else:
log(f'{user} is allowed to borrow {barcode}')
log(f'{who} is allowed to borrow {barcode}')
status = Status.AVAILABLE

return item, status, explanation, when_available
Expand Down

0 comments on commit 857672f

Please sign in to comment.