Skip to content

Commit

Permalink
release: v2.0.0rc7
Browse files Browse the repository at this point in the history
  • Loading branch information
kpsherva committed Mar 4, 2024
1 parent 0d910e4 commit 62cf002
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
12 changes: 12 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@
Changes
=======

Version 2.0.0rc7 (released 2024-03-04)

- circulation: Made loan request start date to be configurable and validated at the backend

Version 2.0.0rc6 (released 2024-02-27)

- facets: fix boolean query

Version 2.0.0rc5 (released 2024-02-21)

- facets: fix range query

Version 2.0.0rc4 (released 2024-02-19)

- stats: emit custom signal for file download
Expand Down
2 changes: 1 addition & 1 deletion invenio_app_ils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@

"""invenio-app-ils."""

__version__ = "2.0.0rc4"
__version__ = "2.0.0rc7"

__all__ = ("__version__",)
4 changes: 3 additions & 1 deletion invenio_app_ils/facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ def inner(values):
for key, value in mappings.items():
args[key] = value
range_query = dsl.query.Range(**{field: args})
terms_query = dsl.Q("terms", **{"state": current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]})
terms_query = dsl.Q(
"terms", **{"state": current_app.config["CIRCULATION_STATES_LOAN_ACTIVE"]}
)

return dsl.query.Bool(must=[range_query, terms_query])

Expand Down
8 changes: 4 additions & 4 deletions tests/api/ils/test_facets.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ def test_current_ranged_loans_filter(app):
overdue = rfilter(["Overdue"])
field = {"lt": str(arrow.utcnow().date())}
assert overdue == dsl.query.Bool(
must=[dsl.query.Range(field=field),
current_loans_query])
must=[dsl.query.Range(field=field), current_loans_query]
)

upcoming = rfilter(["Upcoming return"])
field = {
"gte": str(arrow.utcnow().date()),
"lte": str((arrow.utcnow() + timedelta(days=7)).date()),
}
assert upcoming == dsl.query.Bool(
must=[dsl.query.Range(field=field),
current_loans_query])
must=[dsl.query.Range(field=field), current_loans_query]
)


def test_default_value_when_missing_filter(app):
Expand Down

0 comments on commit 62cf002

Please sign in to comment.