Skip to content

Commit

Permalink
circulation: update invenio-circulation to v1.0.0a30
Browse files Browse the repository at this point in the history
* Fixes for invenio 3.4 compatibility for default state assignment in Loan.
* Fixes type in library class.

Co-Authored-by: Aly Badr <aly.badr@rero.ch>
  • Loading branch information
Aly Badr committed Mar 4, 2021
1 parent 6281165 commit e763948
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
12 changes: 5 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ uwsgitop = ">=0.11"

## Third party invenio modules used by RERO ILS
invenio-oaiharvester = {tag = "v1.0.0a4", git = "https://github.com/inveniosoftware/invenio-oaiharvester.git"}
invenio-circulation = {tag = "v1.0.0a29", git = "https://github.com/inveniosoftware/invenio-circulation.git"}
invenio-circulation = {tag = "v1.0.0a30", git = "https://github.com/inveniosoftware/invenio-circulation.git"}

## Invenio 3.4 base modules used by RERO ILS
# same as invenio metadata extras without invenio-search-ui
Expand Down
2 changes: 1 addition & 1 deletion rero_ils/modules/libraries/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,4 +364,4 @@ def bulk_index(self, record_id_iterator):
:param record_id_iterator: Iterator yielding record UUIDs.
"""
super().bulk_index(record_id_iterator, gdoc_type='lib')
super().bulk_index(record_id_iterator, doc_type='lib')
6 changes: 5 additions & 1 deletion rero_ils/modules/loans/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class Loan(IlsRecord):

def __init__(self, data, model=None):
"""Loan init."""
self['state'] = current_app.config['CIRCULATION_LOAN_INITIAL_STATE']
super().__init__(data, model)

def action_required_params(self, action=None):
Expand Down Expand Up @@ -198,6 +197,11 @@ def create(cls, data, id_=None, delete_pid=True,
:param reindex - index the record after the creation.
"""
data['$schema'] = current_jsonschemas.path_to_url(cls._schema)
# default state assignment
data.setdefault(
'state',
current_app.config['CIRCULATION_LOAN_INITIAL_STATE']
)
if delete_pid and data.get(cls.pid_field):
del(data[cls.pid_field])
cls._loan_build_org_ref(data)
Expand Down

0 comments on commit e763948

Please sign in to comment.